Fast Object Database for Java - with JPA/JDO support

Optimistic lock failed for object

#1

Hi, I seem to be getting a lot of these optimistic locking errors:

Caused by: com.objectdb.o._OptimisticLockException: Optimistic lock failed for object

Is there any way to force the database to use pessimistic locking only?

I've tried various xml configurations, and also various transaction strategies, but they don't seem to work.

Related question: does the JPA implementation understand @Transactional ?

 

 

#2

Please try this settings.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Thanks, that setting is for optimistic locking.

My question was about pessimistic locking (specifically, pessimistic write locking).

Your documentation seems unclear about that.

 

#4

Pessimistic locking is not expected to be applied automatically.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#5

>  Pessimistic locking is not expected to be applied automatically.

How is pessimistic locking set?

I tried to use @Transactional and @Synchronized on all methods that mutate the DB, thinking maybe one of those would lock access to the DB.
Neither seemed to work.

 

#6

See this manual page.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#7

Yep, that's the page that's unclear.

Post Reply