7 Replies Latest reply: Sep 10, 2012 11:01 AM by Joe Weinstein-Oracle RSS

    JDBC begin failed : Connection has already been closed

    user1583259
      Hi,

      We are getting below exception in weblogic server logs while registering Customers through the application.
      Could anyone suggest me for this...

      JDBC begin failed
      java.sql.SQLException: Connection has already been closed.
           at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:55)
           at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92)
           at weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection.getAutoCommit(Unknown Source)
           at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
           at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
           at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.enlistInCurrentTransaction(ExtendedEntityManagerCreator.java:397)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:374)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:332)
           at $Proxy113.createQuery(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1069.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at $Proxy114.getInstitutionDetails(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1191.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:445)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:382)
           at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
           at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
           at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin failed:
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
           at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:41)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.enlistInCurrentTransaction(ExtendedEntityManagerCreator.java:397)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:374)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:332)
           at $Proxy113.createQuery(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1069.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at $Proxy114.getInstitutionDetails(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1191.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:445)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:382)
           at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
           at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
           at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      Caused by: org.hibernate.TransactionException: JDBC begin failed:
           at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
           at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
           at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
           ... 42 more
      Caused by: java.sql.SQLException: Connection has already been closed.
           at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:55)
           at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92)
           at weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection.getAutoCommit(Unknown Source)
           at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
           ... 44 more

      JDBC begin failed
      java.sql.SQLException: Connection has already been closed.
           at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:55)
           at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92)
           at weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection.getAutoCommit(Unknown Source)
           at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
           at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
           at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.enlistInCurrentTransaction(ExtendedEntityManagerCreator.java:397)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:374)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:332)
           at $Proxy113.createQuery(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1069.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at $Proxy114.getInstitutionDetails(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1191.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:445)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:382)
           at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
           at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
           at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      javax.persistence.PersistenceException: org.hibernate.TransactionException: JDBC begin failed:
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
           at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:41)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.enlistInCurrentTransaction(ExtendedEntityManagerCreator.java:397)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:374)
           at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:332)
           at $Proxy113.createQuery(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1069.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at $Proxy114.getInstitutionDetails(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor1191.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:445)
           at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:382)
           at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
           at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
           at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      Caused by: org.hibernate.TransactionException: JDBC begin failed:
           at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
           at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
           at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
           ... 42 more
      Caused by: java.sql.SQLException: Connection has already been closed.
           at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:55)
           at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:92)
           at weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection.getAutoCommit(Unknown Source)
           at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
           ... 44 more

      we are using weblogic 10.3.0
      Oracle 11g (11.2.0.3)

      Below are the datasource configuration we have

      Initial Capacity: 1
      Maximum Capacity: 15
      Capacity Increment: 1
      Statement Cache Size: 10
      Test Connections On Reserve: False
      Seconds to Trust an Idle Pool Connection: 10
      Shrink Frequency: 900
      Connection Creation Retry Frequency: 0
      Inactive Connection Timeout: 0
      Connection Reserve Timeout: 10
      Statement Timeout: -1
      Ignore In-Use Connections: True
      Pinned-To-Thread: False
      Remove Infected Connections Enabled: True

      Thanks in advance

      Thanks,
      Tamil
        • 1. Re: JDBC begin failed : Connection has already been closed
          Kalyan Pasupuleti-Oracle
          Hi,

          It seems that connection object which are requested are in no use.

          To avoid such error enable TestconnectionOn Reserve and restart the server that will avoid such error.

          Regards,
          Kal
          • 2. Re: JDBC begin failed : Connection has already been closed
            user1583259
            Hi Kalyan,

            Thanks, I have provided the wrong configuration details. Please find the correct details below


            Initial Capacity: 1
            Maximum Capacity: 50
            Capacity Increment: 1
            Statement Cache Size: 100
            Test Connections On Reserve: TRUE
            Test Frequency: 120
            Seconds to Trust an Idle Pool Connection: 10
            Shrink Frequency: 900
            Connection Creation Retry Frequency: 0
            Login Delay: 0
            Inactive Connection Timeout: 250
            Maximum Waiting for Connection: 2147483647
            Connection Reserve Timeout: 10
            Statement Timeout: -1
            Ignore In-Use Connections: TRUE
            Pinned-To-Thread: FALSE
            Remove Infected Connections Enabled: TRUE

            Thanks,
            Tamil
            • 3. Re: JDBC begin failed : Connection has already been closed
              Kalyan Pasupuleti-Oracle
              Hi,

              Also enable Connection retry frequency second.


              This will also help you to reconnect Pool.

              Regards,
              Kal
              • 4. Re: JDBC begin failed : Connection has already been closed
                user1583259
                Hi Kalyan,

                It means weblogic has closed the connection?


                Thanks,
                Tamil
                • 5. Re: JDBC begin failed : Connection has already been closed
                  Joe Weinstein-Oracle
                  Please ignore Kalyan's posts, he is incorrect.

                  The exception you see is as it says, the connection that the hibernate code
                  is trying to use, has already been closed, presumably also by hibernate code.
                  If you open an Oracle support case, it might be possible to help you find out
                  where/when it happened.
                  • 6. Re: JDBC begin failed : Connection has already been closed
                    user1583259
                    Hi Joe,


                    Even today also we have faced the same issue at 11:59AM, but when checked the logs we observed the below message at the particular time


                    ####<Sep 10, 2012 11:55:36 AM IST> <Info> <Common> <fccapp01> <AppSrv1> <[ACTIVE] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1347258336124> <BEA-000628> <Created "1" resources for pool "jdbc1", out of which "1" are available and "0" are unavailable.>
                    ####<Sep 10, 2012 11:57:26 AM IST> <Info> <Health> <fccapp01> <AppSrv1> <weblogic.GCMonitor> <<anonymous>> <> <> <1347258446732> <BEA-310002> <13% of the total memory in the server is free>
                    *####<Sep 10, 2012 11:59:19 AM IST> <Info> <Common> <fccapp01> <AppSrv1> <[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1347258559846> <BEA-000628> <Created "1" resources for pool "jdbc1", out of which "1" are available and "0" are unavailable.>*
                    *####<Sep 10, 2012 11:59:30 AM IST> <Info> <Common> <fccapp01> <AppSrv1> <[ACTIVE] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1347258570753> <BEA-000628> <Created "1" resources for pool "jdbc1", out of which "1" are available and "0" are unavailable.>*
                    ####<Sep 10, 2012 12:00:02 PM IST> <Info> <Common> <fccapp01> <AppSrv1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1347258602327> <BEA-000628> <Created "1" resources for pool "jdbc2", out of which "1" are available and "0" are unavailable.>


                    But after that we have seen the below warnings at several times.

                    ####<Sep 10, 2012 12:07:18 PM IST> <Warning> <JDBC> <fccapp01> <AppSrv1> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1347259038313> <BEA-001153> <Forcibly releasing inactive connection "weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@1c8ec1" back into the connection pool "jdbc1", currently reserved by: java.lang.Exception
                         at weblogic.jdbc.common.internal.ConnectionEnv.setup(ConnectionEnv.java:308)
                         at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:314)
                         at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:292)
                         at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:425)
                         at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:316)
                         at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:93)
                         at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:106)
                         at weblogic.jdbc.pool.Driver.connect(Driver.java:149)
                         at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:642)
                         at weblogic.jdbc.jts.Driver.connect(Driver.java:124)
                         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:338)
                         at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
                         at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:421)
                         at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                         at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
                         at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
                         at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
                         at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
                         at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.enlistInCurrentTransaction(ExtendedEntityManagerCreator.java:397)
                         at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:374)
                         at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:332)
                         at $Proxy113.createQuery(Unknown Source)
                         at sun.reflect.GeneratedMethodAccessor1438.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
                         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
                         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
                         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
                         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                         at $Proxy114.getInstitutionLink(Unknown Source)
                         at sun.reflect.GeneratedMethodAccessor2112.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:445)
                         at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:382)
                         at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
                         at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
                         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
                         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
                         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
                         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
                         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
                         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
                         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
                         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
                         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
                         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
                         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
                         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
                         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
                         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
                         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
                         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                    .>


                    when tried to upload the 300 records at the same time it was executed till 150 records and then it says the connection has already been closed.

                    Can we try to apply the patch on weblogic to fix for this issue?


                    Thanks,
                    Tamil
                    • 7. Re: JDBC begin failed : Connection has already been closed
                      Joe Weinstein-Oracle
                      That explains it:

                      ####<Sep 10, 2012 12:07:18 PM IST> <Warning> <JDBC> <fccapp01> <AppSrv1> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1347259038313> <BEA-001153> <Forcibly releasing inactive connection "weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@1c8ec1" back into the connection pool "MPAYBOB",

                      You have configured your pool/DataSource with an inactive connection timeout setting. This means that the pool will take back
                      any connection that the application has reserved, but not used for longer than your set limit. This also means that it the application
                      tries to use the connection subsequently, it will get that 'already closed' message.

                      So, your choices are to either configure your inactive connection timeout to longer than your application holds connections
                      without using them, or alter your application to give back connections to the pool while it is not using them.