Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2080

Incorrect behaviour of suspend/resume JTA Transaction

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: JBossAS-4.0.2 Final
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      JBoss 4.0.2
      Oracle 9.2.0.4
      Oracle JDBC thin driver 10.1.0.2.0

      Description

      XAConnection pool defined in JBoss (see attachment).
      JDBC Connection is resued across TransactionManager suspend/resume calls with second transaction rolled back:

      ================================================================================================
      UserTransaction userTransaction = (UserTransaction)Locator.lookup("java:comp/UserTransaction");
      TransactionManager tm = (TransactionManager)Locator.lookup("java:/TransactionManager");
      DataSource dataSource = Locator.getDataSource("java:/TXDataSource");

      userTransaction.begin();

      Connection connection = dataSource.getConnection();

      // insert record in DB
      doSmth(connection, "A");

      // suspend
      Transaction transaction = tm.suspend();

      // start another transaction
      userTransaction.begin();

      doSmth(connection, "B");

      userTransaction.rollback();

      // resume first tx
      tm.resume(transaction);

      userTransaction.commit();

      ================================================================================================
      // insert method
      private void doSmth(Connection conn, String value) throws SQLException {
      PreparedStatement ps = null;
      try

      { ps = conn.prepareStatement("insert into a(a_name) values(?)"); ps.setString(1, value); ps.executeUpdate(); }


      finally

      { Locator.close(ps); }

      }
      ================================================================================================

      Expected result: 1 rows in a table after execution of the above code. Actual result in JBoss: 2 rows.
      Same test works as expected in WebLogic 8.1.4

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                maximdim Dmitri Maximovich
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: