0 Replies Latest reply on Jan 23, 2007 1:48 PM by Krishna Attravanam

    DB Atomic commit operations

    Krishna Attravanam Newbie

      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