Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-44908

DBPC configuration pool-prepared-statements leads to Statement Leak

      Summary

      DBPC configuration pool-prepared-statements set to true leads to Statement Leak, In case of Oracle DB it will be 'ORA-01000: maximum open cursors exceeded'

      Steps to Reproduce

      1. Configure pool-prepared-statements to true
      2. Wait

      Expected Results

      No pool exception.

      Actual Results

      The below exception is thrown in the atlassian-jira.log file:

      ...
      java.sql.SQLException: ORA-01000: maximum open cursors exceeded
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:179)
      	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:93)  <+2> (DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      	at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      ...
      

      Notes

      DBCP bug: DBCP-372, fixed in 1.5/2.x, JIRA uses 1.3/1.4
      Note from: https://commons.apache.org/proper/commons-dbcp/configuration.html
      NOTE - Make sure your connection has some resources left for the other statements. Pooling PreparedStatements may keep their cursors open in the database, causing a connection to run out of cursors, especially if maxOpenPreparedStatements is left at the default (unlimited) and an application opens a large number of different PreparedStatements per connection. To avoid this problem, maxOpenPreparedStatements should be set to a value less than the maximum number of cursors that can be open on a Connection.

      Workaround

      Remove pool-prepared-statements option (set to false)

            [JRASERVER-44908] DBPC configuration pool-prepared-statements leads to Statement Leak

            Daria Shatsylo (Inactive) made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 740513 ]
            Oksana Levchuk made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 644777 ]
            Tomasz Bartyzel made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 485862 ]
            Bugfix Automation Bot made changes -
            Minimum Version New: 6.01
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2834017 ] New: JAC Bug Workflow v3 [ 2924282 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v7 - Restricted [ 2590123 ] New: JAC Bug Workflow v2 [ 2834017 ]
            Status Original: Closed [ 6 ] New: Resolved [ 5 ]
            Tomasz Bartyzel made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 367305 ]
            Tomasz Bartyzel made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 367409 ]
            Ignat (Inactive) made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v6 - Restricted [ 1537510 ] New: JIRA Bug Workflow w Kanban v7 - Restricted [ 2590123 ]
            Tomasz Bartyzel made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 339175 ]

              morzechowski Michal Orzechowski (Inactive)
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Affected customers:
              2 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: