Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 2.0
    • Labels:
      None

      Description

      passivateObject in PoolableConnectionFactory sets autoCommit to true, even if defaultAutoCommit is set to false. This results in two extra db queries for every use of the connection (set false, do work, set true). This creates a significant amount of overhead, even if the connection is never even used.

      I propose it be changed to:

      if(conn.getAutoCommit() != _defaultAutoCommit)

      { conn.setAutoCommit(_defaultAutoCommit); }

        Activity

        OD created issue -
        Hide
        Phil Steitz added a comment -

        See DBCP-97 and DBCP-102, especially the comment by Dain in DBCP-97. We can discuss changing the implementation, but I tend to agree with Dain that it is better for passivate to prevent idle connections from holding open database transactions. Given the back-and-forth on this, it might be best to make the behavior configurable. Anyone have any better ideas?

        Show
        Phil Steitz added a comment - See DBCP-97 and DBCP-102 , especially the comment by Dain in DBCP-97 . We can discuss changing the implementation, but I tend to agree with Dain that it is better for passivate to prevent idle connections from holding open database transactions. Given the back-and-forth on this, it might be best to make the behavior configurable. Anyone have any better ideas?
        Phil Steitz made changes -
        Field Original Value New Value
        Fix Version/s 1.3.1 [ 12314492 ]
        Fix Version/s 1.4.1 [ 12314493 ]
        Hide
        Phil Steitz added a comment -

        Changing fix version to 2.0. I am still not sure how, if at all, we should address this; but I don't think this can be addressed in a patch release.

        Show
        Phil Steitz added a comment - Changing fix version to 2.0. I am still not sure how, if at all, we should address this; but I don't think this can be addressed in a patch release.
        Phil Steitz made changes -
        Fix Version/s 2.0 [ 12313721 ]
        Fix Version/s 1.3.1 [ 12314492 ]
        Fix Version/s 1.4.1 [ 12314493 ]
        Hide
        James Howe added a comment -

        Re. Dain's comment, there's only a transaction open if one has sent BEGIN without then sending COMMIT/ROLLBACK, which should always have been done on return to pool.

        Would overall performance not be better if new connections are added to the pool to replace disconnected ones, rather than adding all this extra traffic on every request so that the existing connections can use autoReconnect?

        Show
        James Howe added a comment - Re. Dain's comment, there's only a transaction open if one has sent BEGIN without then sending COMMIT/ROLLBACK, which should always have been done on return to pool. Would overall performance not be better if new connections are added to the pool to replace disconnected ones, rather than adding all this extra traffic on every request so that the existing connections can use autoReconnect?
        Hide
        Mark Thomas added a comment -

        New option enableAutoCommitOnReturn added.

        Show
        Mark Thomas added a comment - New option enableAutoCommitOnReturn added.
        Mark Thomas made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Phil Steitz made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1108d 22h 59m 1 Mark Thomas 14/Feb/14 11:47
        Resolved Resolved Closed Closed
        105d 16h 24m 1 Phil Steitz 31/May/14 05:11

          People

          • Assignee:
            Unassigned
            Reporter:
            OD
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development