I did a fresh install of db2 8.1 today, fixed a couple of bugs and got all tests running lickedly split (no errors) on that. The box that 8.1 sits on is very similar to the 7.2 box, save for RAM and CPU power.
However, I do still get an error on 7.2, but not 8.1 - it's the same code, so I don't know what's wrong - maybe the JDBC driver or something.
Code:
SaveContact:
[runservertests] Rhino classes (js.jar) not found - Javascript disabled
[java] [apptracker] DEBUG [TP-Processor3] LoginServlet.execute(215) | Encrypting password for user 'administrator'
[java] [apptracker] DEBUG [TP-Processor3] LoginServlet.execute(226) | Authenticating user 'administrator'
[java] [apptracker] DEBUG [TP-Processor3] GZIPFilter.isGZIPSupported(76) | httpunit detected, disabling filter...
[java] [apptracker] DEBUG [TP-Processor3] GZIPFilter.isGZIPSupported(76) | httpunit detected, disabling filter...
[java] [apptracker] DEBUG [TP-Processor3] ContactAction.edit(135) | Entering 'edit' method
[java] [apptracker] DEBUG [TP-Processor3] GZIPFilter.isGZIPSupported(76) | httpunit detected, disabling filter...
[java] [apptracker] DEBUG [TP-Processor3] ContactAction.save(158) | Entering 'save' method
[java] [apptracker] DEBUG [TP-Processor3] ContactDAOHibernate.saveContact(104) | contact's id: 1
[java] [apptracker] ERROR [TP-Processor3] JDBCExceptionReporter.logExceptions(46) | [IBM][JDBC Driver] CLI0601E Invalid statement handle or statement is closed. SQLSTATE=S1000
[java] [apptracker] ERROR [TP-Processor3] JDBCExceptionReporter.logExceptions(46) | [IBM][JDBC Driver] CLI0601E Invalid statement handle or statement is closed. SQLSTATE=S1000
[java] [apptracker] ERROR [TP-Processor3] JDBCExceptionReporter.logExceptions(46) | [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
[java] [apptracker] ERROR [TP-Processor3] JDBCException.<init>(38) | could not update: [us.co.adams.apptracker.persistence.Contact#1]
[java] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
[java] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:230)
[java] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:394)
[java] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:372)
[java] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.loadParameters(DB2PreparedStatement.java:475)
[java] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.execute2(DB2PreparedStatement.java:674)
[java] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.executeUpdate(DB2PreparedStatement.java:592)
[java] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
[java] at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
[java] at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:672)
[java] at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:625)
[java] at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
[java] at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2308)
[java] at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2262)
[java] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2187)
[java] at us.co.adams.apptracker.persistence.BaseDAOHibernate.saveObject(BaseDAOHibernate.java:100)
[java] at us.co.adams.apptracker.persistence.ContactDAOHibernate.saveContact(ContactDAOHibernate.java:107)
[java] at us.co.adams.apptracker.webapp.service.ContactManagerImpl.saveContact(ContactManagerImpl.java:112)
[java] at us.co.adams.apptracker.webapp.action.ContactAction.save(ContactAction.java:169)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
[java] at us.co.adams.apptracker.webapp.action.BaseAction.execute(BaseAction.java:169)
[java] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
[java] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
[java] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
[java] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at us.co.adams.apptracker.webapp.filter.ActionFilter.doFilter(ActionFilter.java:184)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:95)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at us.co.adams.apptracker.webapp.filter.GZIPFilter.doFilter(GZIPFilter.java:57)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:553)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
[java] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
[java] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
[java] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
[java] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
[java] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
[java] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
[java] at java.lang.Thread.run(Thread.java:554)
[java] [apptracker] ERROR [TP-Processor3] SessionImpl.execute(2269) | Could not synchronize database state with session
[java] net.sf.hibernate.JDBCException: could not update: [us.co.adams.apptracker.persistence.Contact#1]
[java] at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:690)
[java] at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:625)
[java] at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
[java] at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2308)
[java] at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2262)
[java] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2187)
[java] at us.co.adams.apptracker.persistence.BaseDAOHibernate.saveObject(BaseDAOHibernate.java:100)
[java] at us.co.adams.apptracker.persistence.ContactDAOHibernate.saveContact(ContactDAOHibernate.java:107)
[java] at us.co.adams.apptracker.webapp.service.ContactManagerImpl.saveContact(ContactManagerImpl.java:112)
[java] at us.co.adams.apptracker.webapp.action.ContactAction.save(ContactAction.java:169)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
[java] at us.co.adams.apptracker.webapp.action.BaseAction.execute(BaseAction.java:169)
[java] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
[java] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
[java] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
[java] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at us.co.adams.apptracker.webapp.filter.ActionFilter.doFilter(ActionFilter.java:184)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:95)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at us.co.adams.apptracker.webapp.filter.GZIPFilter.doFilter(GZIPFilter.java:57)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
[java] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:553)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
[java] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
[java] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
[java] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
[java] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
[java] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
[java] at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
[java] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
[java] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
[java] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
[java] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
[java] at java.lang.Thread.run(Thread.java:554)
[java] Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
[java] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:230)
[java] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:394)
[java] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:372)
[java] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.loadParameters(DB2PreparedStatement.java:475)
[java] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.execute2(DB2PreparedStatement.java:674)
[java] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.executeUpdate(DB2PreparedStatement.java:592)
[java] at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
[java] at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
[java] at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:672)
[java] ... 61 more
Here's the sequence of calls after ContactAction.save()
ContactAction.java
------------
Code:
ContactManager mgr =
new ContactManagerImpl(ActionFilter.getConnection());
contactForm = (ContactForm) mgr.saveContact(contactForm);
ContactManagerImpl.java
--------------
Code:
public Object saveContact(Object obj)
throws Exception {
if (contact == null) {
contact = new Contact();
}
contactForm = (ContactForm) obj;
// copy form properties to contact
try {
BeanUtils.copyProperties(contact, contactForm);
} catch (IllegalArgumentException i) {
log.error("Exception occured copying properties", i);
throw new ConversionException();
}
if (contact.getContactTypeId() == null) {
contact.setContactTypeId(new Long(0));
}
// all contacts that are "saved" remain active as there
// is no way to de-activate them from the UI (except to delete them)
contact.setActive(Boolean.TRUE);
dao.saveContact(contact);
return getContact(String.valueOf(contact.getId()));
}
ContactDAOHibernate.java
-------
Code:
public Contact saveContact(Contact contact) throws DAOException {
if (log.isDebugEnabled()) {
log.debug("contact's id: " + contact.getId());
}
saveObject(ses, contact);
return contact;
}
BaseDAOHibernate.java
---------
Code:
protected void saveObject(Session ses, Object obj)
throws DAOException {
try {
ses.saveOrUpdate(obj);
ses.flush();
} catch (Exception e) {
try {
ses.connection().rollback();
} catch (Exception ex) {
e.printStackTrace();
}
;
throw new DAOException(e);
}
}
BTW, this code runs fine on MySQL as well.