Cursor troubles using Tamino

We are using Tamino at our company and at one place in my code I need to search through and collect A LOT of records.

I ussually don’t use the cursors in my code, because most of the time it’s not really needed. Now I want to use them, but I can’t get Tamino to use them.

Here is a snippet of my code :

TaminoConnection tConnection = new TaminoConnection("http://localhost:8880/tamino");
TaminoTransaction transaction = tConnection.BeginTransaction(TaminoIsolationLevel.StableCursor, TaminoLockMode.Shared, TaminoLockwait.No);
TaminoCommand command = tConnection.CreateCommand("collection");
TaminoQuery query = TaminoXmlDocument.BuildQuery(null, query);
TaminoQueryResponse tResponse = command.Query(query, 100);

The error I am getting is that the XML Query Timed out. I am trying to use a cursor but it seems to totally ignore my cursor size etc.

I also tried to use different ‘BeginTransaction’ parameters, but none of that helps either.

About the query: It’s a query that binds 2 ‘tables’ together, so it’s pretty intensive for the machine. That’s probably the reason it times out.

I hope anyone can help me and tell me what I am doing wrong.

Thanks in advance!

If you are using Tamino 4.4 then providing a TaminoPreference with a TransactionTimeout specified should hopefully do what you want.

I also tried that, but that had no influence on the imense query time.

But did you ensure that the timeout you specified to TaminoPreference was larger than the total query timeout?

That should prevent the query timing out. If the query is taking a long time then you might want to ask in the XQuery forum how you could optimise the query. One approach is to ensure that you have indexes on the fields that are being searched. Another approach is to change the query so that only a limited number of records are being requested.