Hibernate version: 2.x
Name and version of the database you are using: MySQL
Hello. I have recently started seeing the following error:
afterTransactionCompletion() was never called
My research tells me that the successful execution of either commit or rollback should take care of this, but I'm still seeing the message. I even added some debug code to show me the value of session.wasCommitted(). This value is always true, but I still see the error message (frequently, but not always). Anything else I should be looking for?
Below is the finally {} block where I log/flush/close everything...
boolean wascommitted = false;
try {wascommitted = tx.wasCommitted(); } catch (HibernateException hibex) {logger.error("error calling wascommitted:"+hibex); }
logger.info("calling hibSession.close()...committed?"+wascommitted);
try {hibSession.flush();} catch (HibernateException hexflush) {logger.error("ex on hibSession.flush() "+hexflush);}
try {hibSession.close();} catch (HibernateException hex) {logger.error("ex on hibSession.close() "+hex);}
But I regularly see the following in the log (note the debug value == true):
398315 INFO com.ci.struts.action.GenericAction.execute:151 - calling hibSession.close()...committed?true
398445 WARN net.sf.hibernate.impl.SessionImpl.finalize:3241 - afterTransactionCompletion() was never called
pdf e:java.lang.ArrayIndexOutOfBoundsException: 216
398465 WARN net.sf.hibernate.impl.SessionImpl.finalize:3251 - unclosed connection
I appreciate your time.
chris
|