ObjectDB ObjectDB

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 ?

 

 

edit
delete
#2

Please try this settings.

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

Thanks, that setting is for optimistic locking.

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

Your documentation seems unclear about that.

 

edit
delete
#4

Pessimistic locking is not expected to be applied automatically.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
edit
delete
#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.

 

edit
delete
#6

See this manual page.

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

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

edit
delete

Reply

To post on this website please sign in.