Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-18253

Calling getAutoCommit on a rollback-only transaction throws an SQLException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 30.0.0.Beta1, 30.0.0.Final
    • 26.1.3.Final
    • JCA
    • None
    • ---
    • ---

      The rollback-only state should put a transaction in a mode where only a commit is prohibited, but all the other functionality should work normally. So calling getAutoCommit should simply return true or false, and not throw an exception. Similarly checkTransactionActive should return true; there still is an active transaction, it only is not allowed to commit.

      Caused by: java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_MARKED_ROLLBACK
      at org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:272)
      at org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.java:2005)
      at org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:2020)
      at org.jboss.jca.adapters.jdbc.WrappedConnection.getAutoCommit(WrappedConnection.java:869)
      at com.avaje.ebeaninternal.server.transaction.JdbcTransaction.checkAutoCommit(JdbcTransaction.java:182)
      at com.avaje.ebeaninternal.server.transaction.JdbcTransaction.<init>(JdbcTransaction.java:170)
      ... 67 more

      Still being able to select in a rollback-only transaction is important to handle the reason why it was put in that state; maybe additional data is needed to add detail to any error message.

            rhn-cservice-bbaranow Bartosz Baranowski
            tbee11 Tom Eugelink (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: