0 Replies Latest reply on Jul 8, 2003 10:08 PM by lfinis

    Read-only methods and repeatable read problem

    lfinis

      I'm using commit option A because i need cache.
      Pretty soon it became obvious that i have to mark many getters as "read-only" since too many transactions were rolled back because of the deadlocks.

      My question is: Is it true that commit option A + pessimistic lock + read only methods, is equivalent of READ_COMMITED isolation level?

      Example:
      1)TX1(Session bean) reads "read-only" property on entity bean A without acquiring the lock
      2)TX2 modifies entity bean A (acquires lock and commits).
      3)TX1 has stale data (not repeatable read) and uses this data to update entity bean B.

      Result of all this is inconsistency between bean A and B
      Does the use of "read-only" methods mean compromising on isolation level (consistency).

      Thanks in advance.