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

Autocommit optimization fails when no work is done outside a JTA transaction

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JBossAS-4.0.3 Final
    • JBossAS-4.0.3RC1
    • JCA service
    • None

      The "lazy" auto-commit optimization (to avoid repeated setAutoCommit invocations on the driver/network/db)
      does not work for datasource connections not enlisted in JTA transaction with no work done.

      Example from the forums:
      DataSource ds = getDataSource();
      Connection con = ds.getConnection();
      con.setAutoCommit(false); // not propagated to driver
      con.rollback(); // driver throws an exception because autocommit is true.

      The fix is trivial and probably originally a typo since rollback(Savepoint) has the correct code.

      org.jboss.resource.adapter.jdbc.WrappedConection::rollback()
      {

      • checkStatus();
        + checkTransaction();
        mc.jdbcRollback();
        }

            adrian.brock Adrian Brock (Inactive)
            adrian.brock Adrian Brock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: