Hi Folks,
after reading a persistent object I want manipulate a simple string value of the object and update it to the database.
I'm getting this excpetion:
Code:
java.lang.RuntimeException: Internal inconsistency: A (not new) checking-out statement is not in deathmarch.
at com.mchange.v2.c3p0.stmt.GooGooStatementCache.undeathmarchStatement(GooGooStatementCache.java:437)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache.removeStatement(GooGooStatementCache.java:273)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkinStatement(GooGooStatementCache.java:146)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$1$WrapperStatementHelper.doClose(C3P0PooledConnection.java:429)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.close(C3P0PooledConnection.java:476)
at net.sf.hibernate.impl.BatcherImpl.closePreparedStatement(BatcherImpl.java:246)
at net.sf.hibernate.impl.BatcherImpl.closeStatement(BatcherImpl.java:130)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:119)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2316)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2268)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2211)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:56)
at de.grob.wps.domain.model.mappingcontest.util.HibernateHelper.update(HibernateHelper.java:230)
at de.grob.wps.domain.model.BusinessObjectBOTest.testSetBarcodeWithHibernate(BusinessObjectBOTest.java:180)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
And I used this code to notifiy the update:
Code:
try {
transaction = session.beginTransaction();
session.update(store);
} finally {
if (session != null) {
transaction.commit();
session.flush();
}
}
What did I wrong? Is this probably caused by a bad mapping?
The object contains a m-m set.
Bye & Thx
Toby