0 Replies Latest reply on Feb 12, 2004 12:18 PM by jhenschel

    How does a client detect an optimistic lock on entity beans?

    jhenschel

      Hi all,

      I've set up my JBoss3.2.2 to use optimistic locking as described in the paydocs and it works just fine. When transaction A attempts to write a stale EntityBean (which has bean modified by transaction B), only B's changes are persisted in the DB.

      The problem is, the SessionBean which attempts to write bean A never gets notified that the update failed - I would expect an exception to be raised by the CMP container, but no such thing happens. How can I detect that setXXX on a bean did not commit due to an optimistic lock?

      Thanks for any replies,
      Joerg Henschel