db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell" <craig.russ...@sun.com>
Subject Re: refresh()
Date Tue, 01 May 2007 14:29:26 GMT
Hi Christiaan,

The behavior you describe is consistent with the specification. The
second level cache is intended to be transparent to the application in
most cases.

If you are getting optimistic failures, it might be good to try
flush() within your application, and then refresh with the optimistic
exception parameter, which will refresh all of the failed objects. If
flush followed by refresh doesn't invalidate the second level cache
for the failed objects and go to the datastore, then there is an

Perhaps if you can explain why this behavior doesn't work for your
application we can take a closer look at the issue.

Best regards,



I frequently encounter the situation in which I need the latest data
from the datastore, for instance to avoid optimistic verification
exceptions. According to the spec I would say that
PersistenceManager.refresh() is the right job for this "Refresh the
state of the instance from the data store." However, the JDO
implementation I use has a Level 2 datastore cache and I noticed that
the refresh() not refreshes() the data from the datastore but from the
datastore cache. I've discussed this with them and their argument is
that the datacache is being treated as the datastore. Is this according
to the spec?

Kind regards,


View raw message