0 Replies Latest reply on Jan 22, 2007 8:03 PM by akrishmohan

    Atomic Operations

    akrishmohan

      Hi I have a scenario in which I need to treat DB commit of 2 rows as one atomic operation. How do I achieve this using CMT?

      Any tips would be useful.

      Basically I have something like this.

      public class TestMDBean implements MessageListener {

      @PersistenceContext
      private EntityManagerFactory emf;

      @UserTransaction utx;
      private UserTransaction utx;

      private void updateLog() {
      //populate a pojo entity here in a collection. The collection has 2 objects corresponding to the two rows in the table. Roll back if a single commit fails.

      }

      I am not sure what kind of transaction strategy I need to use here.

      Let me know
      Cheers
      K