Hello 
I encountered some problems with the locking mode "db-locked". 
I use this, in order to exclude that another  application outside castor has
concurrent access to my loaded objects.
If I use this flag, I unfortunately receive an error. As soon as my object
is once contained in the Cache, the renewed loading failes. 
I receive the following error message: 
org.exolab.castor.jdo.PersistenceException: Lock conflict: attempt to load
object of type Test2 with identity 20010815140531026142000000 in two
different
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:47
6)
        at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:694)
        at org.exolab.castor.persist.LockEngine.load(LockEngine.java:355)
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:49
1)
        at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:717)
        at org.exolab.castor.persist.LockEngine.load(LockEngine.java:355)
        at
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:49
1)
        at
org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:219)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImp
l.java:569)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryImp
l.java:552)
        at TestTest.view(TestTest.java:119)
        at TestTest.main(TestTest.java:47)

If I switch the Cache off, i.e.  cache-type="none" this error doesn't occur.


To get around this, I will use now only the cache-off, so I have at least
the desired behavior that the object is loaded from the DB, instead to get
the copy from the cache. 
I do need the db-locked access only for one class but have to turn the cache
off not only for this class but for the base class too. Unfortunately *all*
my persistent objects extend this base class but they would like to use
access mode "shared".

The error occurs after  my past experience, if a back-reference (element of
a list - >container) must be resolved. 
Is this error   well-known or shall I mail you an example for testing ? 


Many greetings Katrin  <<testmap.xml>> 

testmap.xml

Reply via email to