Thomas,

It may seem a little odd, but this is no different from a JDBC connection. One certainly does not want to keep a database open or a transaction open for an extended period of time, especially if it is not needed.

I have not looked into it, but there is a caching option I believe ... that might flush the cache (if it stores these data objects) and re-load if an object is cached ?

Just guessing,

Peter


From: Rhett Sutphin <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what makes JDO think objects are dirty?
Date: Wed, 13 Nov 2002 08:06:09 -0600

On Tuesday, November 12, 2002, at 10:45  PM, Thomas Olausson wrote:
What do I have to tell JDO to load objects
from the database everytime (to make sure
I have fresh data)?

I have a server that finds some objects,
Simple like this:
# db.begin
# get some objects from OQL, using db.getOQLQuery() etc..
# I don't do any rollback or commit, since I don't need to save data
This is the problem: you must end the transaction, even if no data is modified. The idea behind transactions is that they allow you to work with the database pseudo-atomically -- with the data as it existed when the transaction started (when you called db.begin). You have to commit after you finish whatever amount of work needs to be done atomically, and then call db.begin before your next load.

Rhett

=====================================================
| Rhett Sutphin
| Research Assistant (Software)
| Coordinated Laboratory for Computational Genomics
| and the Center for Macular Degeneration
| University of Iowa - Iowa City, IA 52242 - USA
| 4111 MEBRF - email: [EMAIL PROTECTED]
=====================================================

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

Reply via email to