Cursoring and Commit Problem

Hi,

I’d like to create a program with the ff. logic:
1. read thru all my Doctype using a cursor,

accessor.query(TQuery.newInstance(“Directory[@ino:id>0]”),1500)

2. Update some elements in my Doctype

3. Commit the updates every 500 records

if (ctr == 500){
localTransactionUpd.commit();
ctr=0;
}
The problem is the commit command would terminate the transaction and invalidate my TXMLObjectIterator, hence, the query statement would not fetch the next result sets.

I am thinking of creating two connections and localTransaction, one to access the doctypes using cursor, and the other to update my doctypes with commit.

Are there any other ideas to approach the problem? I’d really like to do it with one connection.

Thanks,
greg