1 Reply Latest reply on Jun 24, 2002 8:32 PM by joelvogt

    Locking objects in transactions

      Hello,

      Can someone please tell me if there is a description of what exactly happens in JBoss 3.0 when two transactions use the same entity bean?

      I'd like to exactly know how the two transactions are isolated. For example, as soon as I call findByPrinaryKey() for an entity bean, it is locked, and other transactions must wait until the first transaction commits. It this implemented in JBoss or is it implemented in the database?

      Can I access the same bean from two transactions simultaneously, provided that I only read values?

      Thanks a lot!

      Boris

        • 1. Re: Locking objects in transactions
          joelvogt

          Generally you set the level of transaction locking or serializability.

          From JBoss3.0 Quickstart.pdf
          --

          Transaction Isolation and Locking

          Transactions should be isolated from each other to avoid conflicts because a transaction in
          progress could change data that another transactions depend on. In J2EE there are four
          different levels of isolation:
          Read uncommitted: a transaction can read changes made by another transaction even
          not committed or rolled back.
          Read committed: a transaction cannot read any changed by another transaction until
          it is committed.
          Repeatable reads: a transaction cannot change data read by another transaction
          Serializable: a transaction has exclusive read and write access to the data it is using.
          Note that even this isolation levels are specified in the J2EE specification the
          implementation depends heavily on the underlying database thus even on the same
          application server with different database we can have slightly different behaviors.

          --