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

Need to check transaction status on SQL operations

    XMLWordPrintable

    Details

      Description

      In 4.2.x the transaction timeout rollsback the transaction rather than marking it rollback only.

      This means that for the local transaction datasource the connection has effectively moved onto the next
      transaction.

      Actual code:
      Connection c = datasource.getConnection();
      // tx timeout here
      Statement s = createStatement();
      s.executeUpdate(); // should not work

      Actual Code executed in 4.0.x
      Connection c = pool.getConnection();
      // tx timeout here
      transaction.setRollbackOnly();
      Statement s = createStatement();
      s.executeUpdate();
      tx.rollback(); // Rollsback the update

      Actual Code executed in 4.2.x
      Connection c = pool.getConnection();
      // tx timeout here
      transaction.rollback();
      Statement s = createStatement();
      s.executeUpdate(); // happens "in the next local transaction"

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  adrian.brock Adrian Brock
                  Reporter:
                  adrian.brock Adrian Brock
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: