What happens when Connection#close() is called and there is an active local JDBC transaction for non-JTA datasource connection in JBoss?

Solution Unverified - Updated -

Issue

  • What happens when Connection#close() is called and there's an active local JDBC transaction for non-JTA datasource in JBoss?
  • We are using non-JTA datasource (setting jta="false" to <datasource>) and calling Connection#setAutoCommit(false) to disable auto-commit mode and use local JDBC transaction in our application. When our application call Connection#close() before calling Connection#commit() (or Connection#rollback()) by mistake, it looks the local JDBC transaction is still active in the another requst which uses the returned connection. For example, statement.executeQuery("select current_timestamp;") returns an old timestamp where the previous request start a local JDBC transaction.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.