Commons Dbcp
  1. Commons Dbcp
  2. DBCP-97

setAutoCommit(true) when returning connection to the pool

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      From the Struts user list: [OT] RE: Stackoverflow after DB inactivity
      (MySQL reconnect problem)
      http://www.mail-archive.com/mysql@lists.mysql.com/msg70196.html

      Giving a hint to the database driver that you don't need long running
      transactions makes sense.

      setAutoCommit(true) should be added to PoolableConnectionFactory.passivateObject

        Issue Links

          Activity

          Dirk Verbeeck created issue -
          Hide
          Dirk Verbeeck added a comment -

          implemented in PoolableConnectionFactory revision: 1.14

          Show
          Dirk Verbeeck added a comment - implemented in PoolableConnectionFactory revision: 1.14
          Henri Yandell made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 23293 12340987
          Henri Yandell made changes -
          Project Commons [ 12310458 ] Commons Dbcp [ 12310469 ]
          Component/s Dbcp [ 12311109 ]
          Key COM-836 DBCP-97
          Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
          Affects Version/s Nightly Builds [ 12311648 ]
          Henri Yandell made changes -
          Affects Version/s Nightly Builds [ 12311711 ]
          Phil Steitz made changes -
          Link This issue relates to DBCP-102 [ DBCP-102 ]
          Hide
          Phil Steitz added a comment -

          Need to verify this fix is correct and necessary.

          Show
          Phil Steitz added a comment - Need to verify this fix is correct and necessary.
          Phil Steitz made changes -
          Status Resolved [ 5 ] Reopened [ 4 ]
          Resolution Fixed [ 1 ]
          Phil Steitz made changes -
          Link This issue blocks DBCP-102 [ DBCP-102 ]
          Phil Steitz made changes -
          Link This issue relates to DBCP-102 [ DBCP-102 ]
          Phil Steitz made changes -
          Fix Version/s 1.3 [ 12311977 ]
          Hide
          Dain Sundstrom added a comment -

          Yes, this is correct. When auto commit is off, you have an open transaction with the database, so leaving auto commit off while a connection is idle in the pool is a bad idea.

          One note. The current passivate code has the following block:

          conn.clearWarnings();
          if(!conn.getAutoCommit())

          { conn.setAutoCommit(true); }

          Do we want the clearWarnings() after the potential autocommit change?

          Show
          Dain Sundstrom added a comment - Yes, this is correct. When auto commit is off, you have an open transaction with the database, so leaving auto commit off while a connection is idle in the pool is a bad idea. One note. The current passivate code has the following block: conn.clearWarnings(); if(!conn.getAutoCommit()) { conn.setAutoCommit(true); } Do we want the clearWarnings() after the potential autocommit change?
          Hide
          Dain Sundstrom added a comment -

          Fixed some time ago.

          Show
          Dain Sundstrom added a comment - Fixed some time ago.
          Dain Sundstrom made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Resolved Resolved Reopened Reopened
          1366d 20h 46m 1 Phil Steitz 18/Jun/07 20:29
          Reopened Reopened Closed Closed
          34d 22h 33m 1 Dain Sundstrom 23/Jul/07 19:03

            People

            • Assignee:
              Unassigned
              Reporter:
              Dirk Verbeeck
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development