9 Replies Latest reply on Dec 1, 2006 1:05 PM by Weston M. Price

    enlist of resource failed with Oracle

    Vassili Dzuba Newbie


      i'm trying to use JTA with JDBC in a standalone application.
      JTA version is 4.2.2GA
      Oracle JDBC driver is thin 10g R2

      i'm following the example in chapter 6 of the JTA programmer's guide

      TransactionalDriver arjunaJdbcDriver = new TransactionalDriver();
      Properties dbProps1 = new Properties();
      dbProps1.setProperty(TransactionalDriver.userName, "...");
      dbProps1.setProperty(TransactionalDriver.password, "...");
      dbProps1.setProperty(TransactionalDriver.dynamicClass, "com.arjuna.ats.internal.jdbc.drivers.oracle_8_1_6");
      Connection conn = arjunaJdbcDriver.connect("jdbc:arjuna:jdbc:oracle:thin:@xxxx:1521:yyyy", dbProps1);

      When I try to access two different databases with two connections, everything works as expected.

      However, when I try to access the same database with two different connections (using two different users/passwords), i get an exception :

       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:938)
       at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:244)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:743)
       at com.arjuna.ats.internal.jdbc.ConnectionImple.registerDatabase(ConnectionImple.java:707)
       at com.arjuna.ats.internal.jdbc.ConnectionImple.prepareStatement(ConnectionImple.java:179)

      Is it a bug, or must I do something special while having two connections to the same base in the same transaction ?

      Thanks in advance for any idea.