Pessimistic lock

#1

Dear Sir or Madam,


In the past we used the default Options in the JDO 1.0. See below for reference:

javax.jdo.option.Optimistic=false
javax.jdo.option.NontransactionalRead=true
javax.jdo.option.NontransactionalWrite=false
javax.jdo.option.RetainValues=true
javax.jdo.option.RestoreValues=false

Now we use the following options in DB2:

javax.jdo.option.Optimistic=true
javax.jdo.option.NontransactionalRead=true
javax.jdo.option.NontransactionalWrite=true
javax.jdo.option.RetainValues=true
javax.jdo.option.RestoreValues=false

The DB2 returns the message "Optimistic lock failed for object" or the objects could not be completely build, which results in a NullPointerException.
If we choose the options, we had in DB1 and transfer them to DB2 the following exception is thrown:
"com.objectdb.o._JdoUserException: Attempt to lock an entity object by retrieval when no transaction is activ." This is only in DB2. In DB1 this exception was not present with our adjustments.
Is there a workaround to refloat our old source code? Hope to hear from you.

Yours Faithfully

#2

The context in which these exceptions are thrown is unclear.

Please provide a simple console examples (see these instructions) to demonstrate the situation you have.

ObjectDB Support

Reply