Title: RE: [castor-dev] Simple update yields LockNotGrantedException: persist.writeLockTi meout

I'm using "shared" locking.  I tried "exclusive" locking, and get an exception while attempting to load the object initially:

detailMessage= "Lock conflict: attempt to load object of type com.xyz.Account with identity 123001        in two different"

I'm not sure why this would occur as I have only the one JUnit process running a single test.  Is there a way of extracting more Castor information at runtime?  Any other thoughts how to track this down?

Thank you,
David

-----Original Message-----
From: Bruce Snyder [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 2:53 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Simple update yields LockNotGrantedException:
persist.writeLockTi meout


This one time, at band camp, David Colwell said:

DC>I am attempting a long transaction in which I load an object in one
DC>transaction and modify/store it in another.  The update( ) call fails with
DC>"org.exolab.castor.jdo.LockNotGrantedException: persist.writeLockTimeout"
DC>
DC>The first transaction does something like:
DC>begin( )
DC>OQL query for the object
DC>commit( )
DC>
DC>The second transaction:
DC>begin( )
DC>modify the object
DC>update( )
DC>commit( )
DC>
DC>Does anyone have any experience with this exception?

David,

What kind of locking are you using on your objects in the mapping
descriptor? If you've not specified any, the default lock type is
'shared'.

BTW, typically a long transaction goes as follows:

    begin()
    query for object
    commit()

    modify object

    begin()
    update( object )
    commit()

The notable difference is that the changes are performed between the two
transactions. The reason for the difference is that Database.update()
makes the current transaction aware of the object that was made available
in another transaction, and modified outside of the current transaction.

Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

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

Reply via email to