users@glassfish.java.net

Re: JPA optimistic locking inconsistency

From: <glassfish_at_javadesktop.org>
Date: Thu, 25 Oct 2007 10:00:04 PDT

1. Yes, the @Version value is updated in the database by a database trigger. I have also checked, whether this trigger is working correctly upon external modifications.

2. Yes, when I do a concurrent update via the EntityManager, I get an OptimisticLockException.

3. Yes, after the OptimisticLockException I am getting the correct data on the next access.

4. When I do a concurrent update via external modification, I get a javax.transaction.RollbackException: Transaction marked for rollback. I am getting stale data on the next access.

5. em.refresh(Issue myIssue) is working correctly, when I trigger it manually.

Ulrich
[Message sent by forum member 'ulim' (ulim)]

http://forums.java.net/jive/thread.jspa?messageID=242177