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
#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
#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
#7

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

Reply