-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Connection Leakage errors.
PostPosted: Thu Jan 12, 2006 4:56 pm 
Newbie

Joined: Thu Jan 12, 2006 4:35 pm
Posts: 13
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)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 12, 2006 5:21 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
It looks like a bug in container, but you can help him to close connection in "TransactionSynchrization" callback implementation ("afterTransactionCompletion") or configure JTA related stuff in hibernate (TransactionManager lookup strategy) and use "factory.currentSession()".


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 12, 2006 5:29 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
And use JDBC API for delete queries if DDL forces to commit transaction on your database (probably it is configurable to avoid database level locks and deadlocks).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 12:22 pm 
Newbie

Joined: Thu Jan 12, 2006 4:35 pm
Posts: 13
>And use JDBC API for delete queries if DDL forces to commit transaction
>on your database (probably it is configurable to avoid database level
>locks and deadlocks).

So you are telling me that there is a bug in the Hibernate code, and use JDBC to delete data?

Why should hibernate create and drop tables, can the deletion not be done with out using the concrete tables?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 2:30 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Try JDBC to avoid temprory table creation, some databases commit after DDL automaticaly, it is not clear from you message, but I do not think hibernate commits transaction after delete.
Connection must not be related to this problem, probably container manages connections in a wrong way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.