We have one thread that reads objects from the database ( with read-only access)
We have another thread that updates the objects ( with shared access )
Sometimes we get the following exception:
org.exolab.castor.jdo.LockNotGrantedException: persist.writeLockTimeout
at org.exolab.castor.persist.ObjectLock.acquireUpdateLock(ObjectLock.java:509)
at org.exolab.castor.persist.LockEngine$TypeInfo.acquire(LockEngine.java:1099)
at org.exolab.castor.persist.LockEngine$TypeInfo.access$1(LockEngine.java:1030)
at org.exolab.castor.persist.LockEngine.update(LockEngine.java:627)
at org.exolab.castor.persist.TransactionContext.markUpdate(TransactionContext.java:920)
at org.exolab.castor.persist.TransactionContext.update(TransactionContext.java:991)
at org.exolab.castor.jdo.engine.DatabaseImpl.update(DatabaseImpl.java:353)
It seems that the exception happens immediately, not after the 10 sec,
default LockTimeout value.
I have been looking through the call stack, and in the TransactionContext.markUpdate method, LockEngine.update is called with a
timeout value of 0.
entry.creating = entry.engine.update( this, oid, object, null,0 );
I would have expected the _lockTimeout property of the TransactionContext to be passed on to the LockEngine.update.
Is this correct:
Is there any problem with changing this.
- Michael
