Hello. This has been confusing me for some time, and I’m hoping I can get some insight into what I might be doing wrong.
When I try to access a very large dataset using cursors, I don’t actually get cursor behavior. It still tries to retrieve all the data at once.
Here is a snippet of code that shows what I’m doing:
xmlConnection = new TaminoConnection(dbURL);
xmlConnection.Open(TaminoConnectionMode.AutoCommit);
xmlCommand = xmlConnection.CreateCommand(dbCollection);
string xquery = “input()/assessment”;
TaminoQuery query = TaminoXmlDocument.BuildQuery(null, xquery);
Debug.WriteLine("Query: " + StripCRLF(query.ToString()));
TaminoQueryResponse qr = null;
int PageSize = 100;
try
{
//
// Query the XML and walk through the records returned
//
xmlCommand.Timeout = 60 * 10;
qr = xmlCommand.Query(query, PageSize);
Debug.Assert(qr.ReturnValue.Equals(“0”), qr.ErrorText);
int count = 0;
TaminoPageIterator pageIt = qr.GetPageIterator();
while (pageIt.Next())
{
Console.Write("^");
TaminoItemIterator itemIt = pageIt.GetItemIterator();
while(itemIt.Next())
{
Console.Write(".");
TaminoXmlDocument tamdoc = (TaminoXmlDocument)itemIt.GetItem(typeof(TaminoXmlDocument));
.
.
.
The reason I say it still tries to get everything at once is twofold: First, memory usage climbs like crazy, eventually using all available memory (~1.35GB RAM on a 1.5GB machine). Second, in the code above I can see hundreds or thousands of periods output, but I only ever see one “^” character at the beginning. I would expect to see a “^” every 100 records, but that doesn’t happen.
Any idea what I might be missing?
I’m using the 4.2.1.1 .NET API library with C#.