Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7346

connection pooling not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • Trunk
    • 14.12.01, 15.12.01
    • ALL COMPONENTS
    • None

    Description

      Connection pooling does not seem to work. Connections are created fine but as the close() method is called (outside of transaction) or the transaction is committed the connections are closed to the db server and not returned to the pool.

      I believe the issue is with org.apache.commons.dbcp2.PoolableConnectionFactory passivateObject method. This will call rollback() when rollbackOnReturn is set to true even if the transaction is committed. This is because any connection wrappers extending org.apache.commons.dbcp2.DelegatingConnection cache autoCommit status. At some point, this cached autoCommit is different from the underlying connection autoCommit. The rollback() method will throw an exception and the connection is destroyed rather than put back to the pool

      Environment this has been tested on:
      ofbiz: rev 1725574 and latest trunk (as of 2016-06-14)
      db: postgresql 9.1
      jdbc driver: postgresql-9.3-1101.jdbc4
      os: linux and windows

      I have asked dev ml for others to check this with other dbs. Jacques has test with postgres but could not see this behaviour

      Attachments

        1. DBCPConnectionFactory.patch
          0.8 kB
          Gareth Carter

        Activity

          People

            jleroux Jacques Le Roux
            gareth.carter Gareth Carter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: