1 Reply Latest reply on Jul 1, 2002 5:54 AM by Sacha Labourey

    jboss use pessimistic or optimistic locking mechanism

    fox Newbie

      Dear All

      As far as l know, there are two different approaches to transactional locking: Pessimistic locking
      and optimistic locking. How can l configure the jboss to use either one of above locking mechanism ? l think all j2ee app servers should support "pessimistic" by setting the isolation level to "serialization". But l don't know whether most of server support the "optimistic" or l need to implement this mechnism by the use of bean managed container entity bean.

      Also, if the "optimistic" locking is used, jboss find out there is contention between record in db and the corresponding entity bean when it synchronize the record, how does jboss deal with it (e.g throwing exception ?, if so, what is the class name of the exception). Finally, any distinction in the ejb programming for different locking configuration.

      It is highly appreciated somebody can detailedly explain to me

      Please send your reply to cwso7@netscape.net as well


        • 1. Re: jboss use pessimistic or optimistic locking mechanism
          Sacha Labourey Master

          JBoss uses pessimistic locking at the application server level. The serialisation attribute you speak about is only a DB attribute (locking at the db level, not the app server level) and has not real influence on jboss (until you work in a multi-jboss scenario - clustering)

          Some other locking policies exist (pluggable) but no optimistic locking yet. Bill Burke may publish a document containing detailed discussion on this topic soon.