1 Reply Latest reply on Jan 19, 2009 5:04 AM by Jonathan Halliday

    Transaction expectations (and obligations)

    ben cotton Newbie

      here is the transaction scenario:

      Business transaction START, SERIALIZABLE, PROPAGATION_REQUIRED

      Operation 1, READ_COMMITTED, PROPAGATION_REQUIRED
      Description: Insert rows into the database

      Operation 2, SERIALIZABLE, PROPAGATION_REQUIRED
      Description: Update some rows in the database

      Business transaction END

      Operation 1 and 2 are wrapped by advisors implementing retry logic (by way of AOP). The retry happens only in the event the exception is a Concurrency failure exception.

      My failure scenario:

      1. Operation 1 completes without any database errors.
      2. Operation 2 fails as Sybase chooses it as a deadlock victim.

      Concurrency failure exception is thrown and the AOP based retry logic kicks in which retries the operation. In the same transaction context. This try succeeds and Operation 2 completes.

      At this time, I expect the results of both Operation 1 and Operation 2 to be committed. But I find that only Operation 2's results are committed in the database. Is this behavior consistent with transaction expectations?

      Thanks