Hi,
can you elaborate on the 'sometimes' issue. Is it randomly, or can you detect a
pattern. In addition, it would be interesting to know whether the relation
defined below is bi-directional. And last but not least, can you please post a code
fragment that shows how you are going about updating
AppointmentJdo instances.
Regards
Werner
On Tue, 19 Oct 2004 13:33:51 -0700, Vijayanand Sukumar wrote:
>
>Hi,
>We have been using castor actively for sometime now. In our implementation,
>we have an object referencing other object.
>
>ex:
>
> <class name="com.PCPgo.prm.web.scheduler.AppointmentJdo"
>identity="appointmentId" key-generator="appointment_seq">
> ...
> <field name="patientJdo" type="com.PCPgo.prm.web.patient.PatientJdo">
> <sql name="PA_PATIENT_ID"/>
>
> </field>
> ...
> </class>
>
>We try to update both the objects in the same transaction , which means
>change a field in patientJdo and create appointmentJdo. when we do this
>sometimes it gives the following exception
>
>org.exolab.castor.jdo.LockNotGrantedException: persist.deadlock
> at org.exolab.castor.persist.ObjectLock.detectDeadlock(ObjectLock.java:928)
> at org.exolab.castor.persist.ObjectLock.upgrade(ObjectLock.java(Compiled
>Code))
> at
>org.exolab.castor.persist.LockEngine$TypeInfo.upgrade(LockEngine.java(Compil
>ed Code))
> at
>org.exolab.castor.persist.LockEngine$TypeInfo.access$600(LockEngine.java(Inl
>ined Compiled Code))
> at org.exolab.castor.persist.LockEngine.writeLock(LockEngine.java(Compiled
>Code))
> at
>org.exolab.castor.persist.TransactionContext.writeLock(TransactionContext.ja
>va(Compiled Code))
> at org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java(Compiled
>Code))
> at org.exolab.castor.persist.LockEngine.preStore(LockEngine.java(Compiled
>Code))
> at
>org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java
>(Compiled Code))
> at
>org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java(Compiled
>Code))
> at
>com.PCPgo.prm.web.scheduler.AppointmentAction.execute(AppointmentAction.java
>(Compiled Code))
>
>and it locks the patientJdo object.
>
>Is this the right way of doing it. Also , is there any way of release a lock
>obtained on a object ?
>The reason is once an object is locked, there is no way of releasing the
>lock, and we cannot do anything
>to the object (I mean update even in a different transaction) until the
>server is restarted ?
>
>Thanks
>
>Vijay
>
>
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
> unsubscribe castor-user
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user