0 Replies Latest reply on Oct 3, 2009 12:24 PM by Sandeep Vaid

    CMT and Connection Objects

    Sandeep Vaid Newbie

      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public void someMethod(...) {
      // obtain con1 and con2 connection objects
      con1 = ...;
      con2 = ...;
      stmt1 = con1.createStatement();
      stmt2 = con2.createStatement();

      //
      // Perform some updates on con1 and con2. The container
      // automatically enlists con1 and con2 with the container-
      // managed transaction.
      //
      }

      As we have specified TransactionAttributeType.REQUIRED, container will start a transaction (i guess on a Connection)
      Q- a) Container will start transaction on which Connection (database) Object? From where it obtains information about my database ?
      In other words does container uses JTA (Distributed transaction manager layer), from where it obtains info regarding my databses,
      user password, url etc..
      Q- b) What does the statement means "The container automatically enlists con1 and con2 with the container-manager transaction"?