Hi Christiaan,

On May 2, 2007, at 12:54 AM, Christiaan des Bouvrie wrote:

"// get fresh instances from the datastore
pm.getDataStoreCache().evictAll(collection);
pm.refresh(collection);"

That was indeed my initial approach. Unfortunately the evictAll()
nullifies references in the pc objects which caused
nullpointerexceptions in our multi-threaded application (multi- threaded
option is set to true).

This sounds like a bug in the jdo implementation. The use of evictAll should never cause side effects other than performance. That is, when you evict instances from the DataStoreCache, the effect is that access to the evicted instance must use the connection to the datastore instead of using the cached instance.

In fact, the use of the Multithreaded flag is intended to make your application run correctly with multiple threads using the same PersistenceManager at the expense of running slower.

Multithreaded access to the PersistenceManagerFactory and DataStoreCache is always thread-safe. Note that access to the DataStoreCache is not related to PersistenceManager but PersistenceManagerFactory.

Regards,

Craig



Kind regards,

Christiaan


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to