can you please provide the relevant fragments of the code you are using (to be able to verify my assumption), but
looking at this exception, I'd be tempted to say that you are trying to iterate over the related objects after you've
committed your original transaction.
This is sample code that produces this problem:
OQLQuery query = gdmDatabase.getOQLQuery(
"select p from jbapp.JbProduct p order by upper(productName)");
QueryResults results = query.execute(Database.ReadOnly);
while(results.hasMore()) {
JbProduct jbProduct = (JbProduct) results.next();
}
results.close();
query.close();I am fairly certain that nothing is being closed, committed, or rolled back until after the loop. The stack trace shows that the exception is occuring on my second call to results.hasMore().
I do not encounter this problem if I do not have any object relationships in my JbProduct mapping definition. However, if I include this in my mapping definition I do:
<field name="publisher" type="jbapp.Publisher" direct="false">
<sql name="publisher_id" />
</field>I believe the mapping for the jbapp.Publisher class to be correct, and I can query Publisher objects independently provided they do not have relationships to the JbProduct objects.
Thanks.
John
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
