2 Replies Latest reply on Sep 4, 2007 9:54 AM by Vadim Melnik

    UserTransaction & automatic resources enlistment

    Vadim Melnik Newbie

      Hello All,

      It's going to be very easy to make with JBoss AS, but unfortunately I am not able to figure out how:

      We need to configure JBoss 4.2.1.GA (Arjuna 4.3.2.SP5?) web application to work with transactions in similar to JOTM way, with automatic DB resources enlistment/de-listment and UserTransaction-based demarcation mechanism. E.g.:

      1) UserTransaction is retrieved via JNDI "java:comp/UserTransaction" lookup.
      2) Transaction started by UserTransaction.begin() call.
      3) Some client code retrieves DB connection on the same thread, e.g. via JNDI "java:db_pool" lookup.
      4) Retrieved "java:db_pool" connection should be automatically enlisted in current transaction.
      5) Client closes "java:db_pool" connection.
      6) Transaction is committed or rolled back by UserTransaction.commit() | UserTransaction.rollback() APIs.

      Actually I created test case for steps described above, configured JBoss 4.2.1.GA DB "java:db_pool" connection as <local-tx-datasource> datasource but according to test results, "java:db_pool" connection is not enlisted in current transaction. Are there any samples demonstrating similar technique we need?

      Thanks in advance,