Hi
I am using Hibernate 3.1. In the scenario described below I am getting connection leakage errors. My app server is OC4J. I am using CMT EJBs for all the business logic (and the hibernate code is invoked from EJBs).
I have a Java object Job mapped to oracle table JOB. Then I have another Java object MessageJob derived from Job, this subclass is mapped to another oracle table MESSAGE_JOB. I have used the <joined-subclass> in creating the hibernate mapping file for Job and MessageJob.
The inserts, updates individual deletes work fine. When I try to delete Job objects like below...
session.createQuery( "delete from Job j where j.status = :status" ) .setString( "status", pStatus ) .executeUpdate();
functionally the jobs are deleted as I intended to, but at the end I got the following exception (I placed the exception at the end of the message, so that the reading can be easy).
When I looked at the sequence sqls executed by hibernate, I have seen that hibernate is creating a temporary table, inserting all the jobIds in to that temporary table, then deleting from messege_job table, job table in that order and dropping the temporary table.
When ever a DDL statement is executed, the transaction gets committed, I am not sure if that is causing any problem here. Is this error because of bug with hibernate, or a bug in my code ?
Thanks
Srikanth
06/01/12 14:50:03 OrionCMTConnection not closed, check your code!
06/01/12 14:50:03 Logical connection not closed, check your code!
06/01/12 14:50:03 Created at:
06/01/12 14:50:03 java.lang.Throwable: OrionCMTConnection created
06/01/12 14:50:03 at com.evermind.sql.OrionCMTConnection.<init>(OrionCMTConnection.java:47)
06/01/12 14:50:03 at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:87)
06/01/12 14:50:03 at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
06/01/12 14:50:03 at org.hibernate.jdbc.JDBCContext.userConnection(JDBCContext.java:117)
06/01/12 14:50:03 at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:373)
06/01/12 14:50:03 at org.hibernate.hql.ast.exec.AbstractStatementExecutor.createTemporaryTableIfNecessary(AbstractStatementExecutor.java:111)
06/01/12 14:50:03 at org.hibernate.hql.ast.exec.MultiTableDeleteExecutor.execute(MultiTableDeleteExecutor.java:77)
06/01/12 14:50:03 at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:326)
06/01/12 14:50:03 at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:202)
06/01/12 14:50:03 at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1111)
06/01/12 14:50:03 at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
06/01/12 14:50:03 at com.senior.dal.shared.jobs.JobDAO.deleteByStatus(JobDAO.java:128)
06/01/12 14:50:03 at com.senior.bll.entity.constituent.messaging.schedules.MsgScheduleEJBAction.processEvent(MsgScheduleEJBAction.java:75)
06/01/12 14:50:03 at com.senior.bll.shared.dispatcher.EJBEventDispatcherSB.dispatchEvent(EJBEventDispatcherSB.java:58)
06/01/12 14:50:03 at IEJBEventDispatcherSBLocal_StatelessSessionBeanWrapper2.dispatchEvent(IEJBEventDispatcherSBLocal_StatelessSessionBeanWrapper2.java:97)
06/01/12 14:50:03 at com.senior.web.shared.EJBEventDispatcher.dispatchEvent(EJBEventDispatcher.java:49)
06/01/12 14:50:03 at com.senior.web.faces.bean.constituent.messaging.schedules.MsgScheduleManagerFace.doDeleteAllCompleted(MsgScheduleManagerFace.java:552)
06/01/12 14:50:03 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06/01/12 14:50:03 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
06/01/12 14:50:03 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
06/01/12 14:50:03 at java.lang.reflect.Method.invoke(Method.java:324)
06/01/12 14:50:03 at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
06/01/12 14:50:03 at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
06/01/12 14:50:03 at javax.faces.component.UICommand.broadcast(UICommand.java:106)
06/01/12 14:50:03 at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
06/01/12 14:50:03 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
06/01/12 14:50:03 at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:321)
06/01/12 14:50:03 at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:87)
06/01/12 14:50:03 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
06/01/12 14:50:03 at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
06/01/12 14:50:03 at com.senior.servlet.SeniorFacesServlet.service(SeniorFacesServlet.java:25)
06/01/12 14:50:03 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
06/01/12 14:50:03 at com.senior.web.filter.SessionCleaner.doFilter(SessionCleaner.java:141)
06/01/12 14:50:03 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
06/01/12 14:50:03 at com.senior.web.filter.AuthFilter.doFilter(AuthFilter.java:153)
06/01/12 14:50:03 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
06/01/12 14:50:03 at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:123)
06/01/12 14:50:03 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
06/01/12 14:50:03 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
06/01/12 14:50:03 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
06/01/12 14:50:03 at java.lang.Thread.run(Thread.java:534)
06/01/12 14:50:03 LogicalDriverManagerXAConnection not closed, check your code!
06/01/12 14:50:03 com.evermind.sql.LogicalDriverManagerXAConnection@158be90 was Created at:
06/01/12 14:50:03 java.lang.Throwable: LogicalDriverManagerXAConnection created
06/01/12 14:50:03 at com.evermind.sql.LogicalDriverManagerXAConnection.<init>(LogicalDriverManagerXAConnection.java:33)
06/01/12 14:50:03 at com.evermind.sql.DriverManagerXAConnection.getNewLogicalConnection(DriverManagerXAConnection.java:543)
06/01/12 14:50:03 at com.evermind.sql.DriverManagerPooledConnection.getConnection(DriverManagerPooledConnection.java:121)
06/01/12 14:50:03 at com.evermind.sql.OrionCMTConnection.setConnection(OrionCMTConnection.java:212)
06/01/12 14:50:03 at com.evermind.sql.OrionCMTConnection.intercept(OrionCMTConnection.java:128)
06/01/12 14:50:03 at com.evermind.sql.FilterConnection.createStatement(FilterConnection.java:278)
06/01/12 14:50:03 at com.evermind.sql.ConnectionBCELProxy.createStatement(ConnectionBCELProxy.java:40)
06/01/12 14:50:03 at org.hibernate.hql.ast.exec.AbstractStatementExecutor.createTemporaryTableIfNecessary(AbstractStatementExecutor.java:111)
06/01/12 14:50:03 at org.hibernate.hql.ast.exec.MultiTableDeleteExecutor.execute(MultiTableDeleteExecutor.java:77)
06/01/12 14:50:03 at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:326)
06/01/12 14:50:03 at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:202)
06/01/12 14:50:03 at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1111)
06/01/12 14:50:03 at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
06/01/12 14:50:03 at com.senior.dal.shared.jobs.JobDAO.deleteByStatus(JobDAO.java:128)
06/01/12 14:50:03 at com.senior.bll.entity.constituent.messaging.schedules.MsgScheduleEJBAction.processEvent(MsgScheduleEJBAction.java:74)
06/01/12 14:50:03 at com.senior.bll.shared.dispatcher.EJBEventDispatcherSB.dispatchEvent(EJBEventDispatcherSB.java:58)
06/01/12 14:50:03 at IEJBEventDispatcherSBLocal_StatelessSessionBeanWrapper2.dispatchEvent(IEJBEventDispatcherSBLocal_StatelessSessionBeanWrapper2.java:97)
06/01/12 14:50:03 at com.senior.web.shared.EJBEventDispatcher.dispatchEvent(EJBEventDispatcher.java:49)
06/01/12 14:50:03 at com.senior.web.faces.bean.constituent.messaging.schedules.MsgScheduleManagerFace.doDeleteAllCompleted(MsgScheduleManagerFace.java:552)
06/01/12 14:50:03 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06/01/12 14:50:03 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
06/01/12 14:50:03 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
06/01/12 14:50:03 at java.lang.reflect.Method.invoke(Method.java:324)
06/01/12 14:50:03 at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
06/01/12 14:50:03 at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
06/01/12 14:50:03 at javax.faces.component.UICommand.broadcast(UICommand.java:106)
06/01/12 14:50:03 at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
06/01/12 14:50:03 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
06/01/12 14:50:03 at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:321)
06/01/12 14:50:03 at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:87)
06/01/12 14:50:03 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
06/01/12 14:50:03 at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
06/01/12 14:50:03 at com.senior.servlet.SeniorFacesServlet.service(SeniorFacesServlet.java:25)
06/01/12 14:50:03 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
06/01/12 14:50:03 at com.senior.web.filter.SessionCleaner.doFilter(SessionCleaner.java:141)
06/01/12 14:50:03 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
06/01/12 14:50:03 at com.senior.web.filter.AuthFilter.doFilter(AuthFilter.java:153)
06/01/12 14:50:03 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
06/01/12 14:50:03 at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:123)
06/01/12 14:50:03 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
06/01/12 14:50:03 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
06/01/12 14:50:03 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
06/01/12 14:50:03 at java.lang.Thread.run(Thread.java:534)
06/01/12 14:50:03 OrionCMTConnection not closed, check your code!
06/01/12 14:50:03 Logical connection not closed, check your code!
06/01/12 14:50:03 Created at:
06/01/12 14:50:03 java.lang.Throwable: OrionCMTConnection created
06/01/12 14:50:03 at com.evermind.sql.OrionCMTConnection.<init>(OrionCMTConnection.java:47)
06/01/12 14:50:03 at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.java:87)
06/01/12 14:50:03 at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
06/01/12 14:50:03 at org.hibernate.jdbc.JDBCContext.userConnection(JDBCContext.java:117)
06/01/12 14:50:03 at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:373)
06/01/12 14:50:03 at org.hibernate.hql.ast.exec.AbstractStatementExecutor.createTemporaryTableIfNecessary(AbstractStatementExecutor.java:111)
06/01/12 14:50:03 at org.hibernate.hql.ast.exec.MultiTableDeleteExecutor.execute(MultiTableDeleteExecutor.java:77)
06/01/12 14:50:03 at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:326)
06/01/12 14:50:03 at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:202)
06/01/12 14:50:03 at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1111)
06/01/12 14:50:03 at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
06/01/12 14:50:03 at com.senior.dal.shared.jobs.JobDAO.deleteByStatus(JobDAO.java:128)
06/01/12 14:50:03 at com.senior.bll.entity.constituent.messaging.schedules.MsgScheduleEJBAction.processEvent(MsgScheduleEJBAction.java:74)
06/01/12 14:50:03 at com.senior.bll.shared.dispatcher.EJBEventDispatcherSB.dispatchEvent(EJBEventDispatcherSB.java:58)
06/01/12 14:50:03 at IEJBEventDispatcherSBLocal_StatelessSessionBeanWrapper2.dispatchEvent(IEJBEventDispatcherSBLocal_StatelessSessionBeanWrapper2.java:97)
06/01/12 14:50:03 at com.senior.web.shared.EJBEventDispatcher.dispatchEvent(EJBEventDispatcher.java:49)
06/01/12 14:50:03 at com.senior.web.faces.bean.constituent.messaging.schedules.MsgScheduleManagerFace.doDeleteAllCompleted(MsgScheduleManagerFace.java:552)
06/01/12 14:50:03 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06/01/12 14:50:03 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
06/01/12 14:50:03 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
06/01/12 14:50:03 at java.lang.reflect.Method.invoke(Method.java:324)
06/01/12 14:50:03 at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
06/01/12 14:50:03 at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
06/01/12 14:50:03 at javax.faces.component.UICommand.broadcast(UICommand.java:106)
06/01/12 14:50:03 at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
06/01/12 14:50:03 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
06/01/12 14:50:03 at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:321)
06/01/12 14:50:03 at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:87)
06/01/12 14:50:03 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
06/01/12 14:50:03 at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
06/01/12 14:50:03 at com.senior.servlet.SeniorFacesServlet.service(SeniorFacesServlet.java:25)
06/01/12 14:50:03 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
06/01/12 14:50:03 at com.senior.web.filter.SessionCleaner.doFilter(SessionCleaner.java:141)
06/01/12 14:50:03 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
06/01/12 14:50:03 at com.senior.web.filter.AuthFilter.doFilter(AuthFilter.java:153)
06/01/12 14:50:03 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
06/01/12 14:50:03 at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:123)
06/01/12 14:50:03 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
06/01/12 14:50:03 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
06/01/12 14:50:03 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
06/01/12 14:50:03 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
06/01/12 14:50:03 at java.lang.Thread.run(Thread.java:534)
|