Uploaded image for project: 'Hibernate ORM'
  1. HHH-7412

JDBCTransactionFactory.getDefaultReleaseMode() returns incorrect ConnectionReleaseMode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.4, 5.0.0.CR2
    • Fix Version/s: 5.1.1
    • Component/s: hibernate-core
    • Environment:
      4.1.4.Final
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      JdbcTransactionFactory does this:

      public ConnectionReleaseMode getDefaultReleaseMode()

      { return ConnectionReleaseMode.ON_CLOSE; }

      This seems to be a mistake because:

      1) In section 13.5. Connection release modes of the 4.1.4.Final Core Reference Manual it says:

      for JDBCTransactionFactory, [org.hibernate.transaction.TransactionFactory.getDefaultReleaseMode()] returns ConnectionReleaseMode.AFTER_TRANSACTION

      2) In ConnectionReleaseMode.java it says:

      /**

      • Indicates that JDBC connections should be released after each transaction
      • ends (works with both JTA-registered synch and HibernateTransaction API).
      • This mode may not be used with an application server JTA datasource.
      • <p/>
      • This is the default mode starting in 3.1; was previously {@link #ON_CLOSE}

        .
        */
        AFTER_TRANSACTION("after_transaction"),

      You can work around this by setting hibernate.connection.release_mode=after_transaction

        Attachments

          Issue links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: