1 Reply Latest reply on Jun 13, 2006 2:40 PM by Tamir Efron

    Optimistic Locking & Versioning

    Sean Dawson Newbie


      I've added a @Version annotation to my entity beans, hoping to take advantage of the optimistic locking provided by JBoss. My understanding is that the EntityManager is responsible for incrementing the version number when an object is persisted; is this correct?

      Currently, the EntityManager is not updating the Version property when an object is persisted. The EntityManager is, however, throwing StaleObject exceptions if I manually change the version number on an Entity and then try to persist it.

      Is there extra configuration needed to enable version incrementing when objects are persisted, or is this not possible / supported?

      Thank you,
      Sean Dawson