how can I solved "Transaction aborted because it has taken t

when I query the xml file ,if the result is so big,how can I limit the size,for example,in many api,we can use setFetchSize method to limit the result size every time,then call next method to get next size result,but I can’t find the method in Tamino API,how can I implement it?must I write the query statement?
for example,when the result is very big,it will throws the execption as following:

[Query:main:141] – NestedException:Tamino access failure (INOXYE9291, Transaction aborted because it has taken too long)


Thank you very much!
Best regards,
Gavinzheng

Gavin,

You should use cursor or position() to limit the result return. (refer to API Doc)

Tony

Hello Gavin,

the methods in the API that you are looking for are in the TXMLObjectAccessor class, either:

   query(TQuery query, int quantity)</pre><BR>For executing an X-Query, or<BR><pre class="ip-ubbcode-code-pre">   xquery(TXQuery xquery, int quantity)


For executing an XQuery. Both will set the “fetch size” of the results. When you iterate over the results of the query, the API will automatically fetch the next set of results (“under the covers”, so to say).

Before calling the methods with a “quantity”, you need to switch to Local Transaction mode (rather than the default “auto commit” mode). This is accomplished by calling the method “useLocalTransactionMode()” on your TConnection object.
(This method returns an instance of TLocalTransaction, which you can keep a reference to in case you want to commit or rollback the transaction later. This is done by calling the commit() or rollback() method as appropriate.)

I hope that helps,
Trevor.