Anybody knows if c3p0 0.8.5 works with hibernate 2.1.7 (the one released with hibernate is c3p0 0.8.4.5). Somehow we got intermittent jdbc exceptions (sometimes at session.commit(), some like the following stack traces, always at BatchImpl class). The problem is not always reproducible.
We have to use c3p0 0.8.5 because it has a bug fix we need, but it looks like it has more problems. :-(
Thanks,
--Jiunjiun
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:[/b]
2.1.7c
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():[/b]
try {
session = getSession();
transaction = session.beginTransaction();
if (object == null) {
session.delete(deleteQueryString, values, types);
} else {
if (isTransient(session, object)) {
session.delete(deleteQueryString, values, types);
}
session.saveOrUpdate(object);
}
transaction.commit();
} catch (Exception exception) {
try {
if (transaction != null) { transaction.rollback(); }
} catch (HibernateException e) {
// ignore nested exception
}
PersistenceOperationException newException =
new PersistenceOperationException(exception.getMessage(),exception);
throw newException;
} finally {
try {
if (session != null) { session.close(); }
} catch (HibernateException e) {
// ignore exception
}
}
protected Session getSession() throws HibernateException {
return getSessionFactory().openSession();
}
[b]Full stack trace of any exception that occurs:[/b]
FINE: Could not save objectjava.sql.SQLException: You can't operate on a closed connection!!! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:68) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.close(NewProxyPreparedStatement.java:1682) at net.sf.hibernate.impl.BatcherImpl.closePreparedStatement(BatcherImpl.java:273) at net.sf.hibernate.impl.BatcherImpl.closeStatement(BatcherImpl.java:141) at net.sf.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:84) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:774) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:747) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1397) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436) at net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:526) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:482) at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1484) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1402) at com.sun.hss.domain.internal.HibernatePersistenceToolkit.store(HibernatePersistenceToolkit.java:102) at com.sun.hss.domain.internal.PersistentMBeanSupport.store(PersistentMBeanSupport.java:87) at com.sun.hss.domain.internal.MonitoringData.store(MonitoringServiceMXBeanImpl.java:1724) at com.sun.hss.domain.internal.MonitoringData.setThresholds(MonitoringServiceMXBeanImpl.java:1996) at com.sun.hss.domain.internal.MonitoringServiceMXBeanImpl.setThresholds(MonitoringServiceMXBeanImpl.java:889) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:414) at javax.management.StandardMBean.invoke(StandardMBean.java:421) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at com.sun.jdmk.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:203) at com.sun.jdmk.JdmkMBeanServerImpl.invoke(JdmkMBeanServerImpl.java:764) at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201) at $Proxy13.setThresholds(Unknown Source) at com.sun.hss.services.svrmgmt.impl.SvrMonitorDelegate.setThreshholds(SvrMonitorDelegate.java:271) at com.sun.hss.services.svrmgmt.impl.SvrMonitorDelegate.setServerThreshholds(SvrMonitorDelegate.java:137) at com.sun.hss.services.svrmgmt.impl.SvrMgmtService.setServerThreshholds(SvrMgmtService.java:659) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:414)
at javax.management.StandardMBean.invoke(StandardMBean.java:421)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at com.sun.jdmk.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:203)
at com.sun.cacao.agent.DispatchInterceptor.invoke(DispatchInterceptor.java:806)
at com.sun.jdmk.JdmkMBeanServerImpl.invoke(JdmkMBeanServerImpl.java:764)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201)
at com.sun.cacao.agent.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:212)
at $Proxy10.setServerThreshholds(Unknown Source)
at com.sun.hss.ui.commands.server.SetServerThresholdCommand.executeCommand(SetServerThresholdCommand.java:71)
at com.sun.hss.ui.commands.AbstractCommand.execute(AbstractCommand.java:80)
at com.sun.hss.ui.commands.CommandProcessor.execute(CommandProcessor.java:138)
at com.sun.hss.ui.commands.CommandProcessor.process(CommandProcessor.java:110)
at com.sun.hss.ui.commands.cacao.CommandParserCommand.execute(CommandParserCommand.java:201)
at com.sun.cacao.commandstream.shell.Shell.execute(Shell.java:212)
at com.sun.cacao.commandstream.CommandStreamAdaptor$1.run(CommandStreamAdaptor.java:592)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:379)
at com.sun.cacao.commandstream.CommandStreamAdaptor$ClientRun.run(CommandStreamAdaptor.java:588)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NullPointerException
at org.postgresql.jdbc1.AbstractJdbc1Statement.getResultSet(AbstractJdbc1Statement.java:769)
at org.postgresql.jdbc1.AbstractJdbc1Statement.close(AbstractJdbc1Statement.java:789)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.close(NewProxyPreparedStatement.java:1674)
... 63 more
[b]Name and version of the database you are using:[/b]
Postgres 7.x
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]