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

DBPC configuration pool-prepared-statements leads to Statement Leak

    XMLWordPrintable

Details

    Description

      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)

      Attachments

        Issue Links

          Activity

            People

              morzechowski Michal Orzechowski (Inactive)
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: