Hello everyone,
I really need the help of some experienced developers. I really would appreciate it. I have already successfully programmed a class with a connection to Tamino server. Just the XQuery solution is important to me.
So far it works fine with a very small document (5 nodes) but I get a “INOXYE9291, Transaction aborted because it has taken too long” for my other database, which has about 200,000 nodes.
I am still working on the cursor and hope this will help me out.
My first experience was the cursor won’t work without a localTransactionmode at all.
E.g. if case of the smaller DB with 5 nodes, it would run fine with a cursor value about 5 or higher. But if the cursor value is lower I get an exception.
TResponse response = accessor.xquery(xquery, 2);
</pre><BR><BR>The only solution was to add this line of code:<BR><BR><pre class="ip-ubbcode-code-pre">
TLocalTransaction tloc = connection.useLocalTransactionMode();
</pre><BR><BR>and then it works fine but as I mentioned before just with the smaller DB.<BR>The bigger database gets everytime a INOXYE9291 exception at this line:<BR><BR><pre class="ip-ubbcode-code-pre">
TResponse response = accessor.xquery(xquery, 5000);
</pre><BR><BR>(I have already increased the maximum transaction duration to 900 s)<BR><BR>I expect a result with 80809 recordsets. I think it makes sense to set the cursor value to 5000. I have inserted my java code and hope you can help me. I know the code is still very bad regarding the exceptions. Maybe I miss something.<BR><BR><BR><pre class="ip-ubbcode-code-pre">
package perfanx;
import com.softwareag.tamino.db.api.accessor.*;
import com.softwareag.tamino.db.api.common.*;
import com.softwareag.tamino.db.api.connection.*;
import com.softwareag.tamino.db.api.objectModel.*;
import com.softwareag.tamino.db.api.objectModel.dom.*;
import com.softwareag.tamino.db.api.response.*;
import org.jdom.*;
import org.jdom.input.*;
import java.io.*;
import com.softwareag.tamino.db.api.io.TStreamWriteException;
import com.softwareag.tamino.db.api.objectModel.sax.TSAXObjectModel;
import com.softwareag.tamino.db.api.objectModel.sax.*;
public class XQ_Tamino_Exp_6 {
private TXMLObjectAccessor accessor = null;
private TConnection connection = null;
public XQ_Tamino_Exp_6(String query, String databaseURI, String collection) throws
TConnectionException,
TXQueryException, TStreamWriteException, TIteratorException,
TNoSuchXMLObjectException {
TConnectionFactory connectionFactory = TConnectionFactory.getInstance();
connection = connectionFactory.newConnection(databaseURI);
TXQuery xquery = TXQuery.newInstance(query);
TXMLObjectAccessor accessor = connection.newXMLObjectAccessor(
TAccessLocation.newInstance(collection), TDOMObjectModel.getInstance());
TLocalTransaction tloc = connection.useLocalTransactionMode();
TResponse response = accessor.xquery(xquery, 5000);
TXMLObjectIterator iterator = response.getXMLObjectIterator();
//Output as XML
OutputAsXML(iterator);
connection.close();
}
}
Thank you very much,
Houman Khorasani
University of Wisconsin Platteville