hi,
i have a problem about parent/child data object save in two databases or load from one database and save it to another database problem.
i use two config file to use two databases,one sqlserver,one hsqldb,
How can i save them?
Thanks in advance!
the following is exception information:
严重: An operation failed due to stale data
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for model.AccountCurrency instance with identifier: 1
at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:502)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:671)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:641)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2336)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at common.hibernate._RootDAO.save(_RootDAO.java:345)
at common.hibernate.base.BaseAccountDAO.save(BaseAccountDAO.java:38)
at common.hibernate.test.MultiCompanyTest.testChartOfAccountDAO(MultiCompanyTest.java:126)
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 junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at junit.textui.TestRunner.run(TestRunner.java:72)
at common.hibernate.test.MultiCompanyTest.main(MultiCompanyTest.java:32)
2004-4-14 21:32:24 net.sf.hibernate.impl.SessionImpl execute
严重: Could not synchronize database state with session
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for model.AccountCurrency instance with identifier: 1
at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:502)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:671)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:641)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2336)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at common.hibernate._RootDAO.save(_RootDAO.java:345)
at common.hibernate.base.BaseAccountDAO.save(BaseAccountDAO.java:38)
at common.hibernate.test.MultiCompanyTest.testChartOfAccountDAO(MultiCompanyTest.java:126)
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 junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at junit.textui.TestRunner.run(TestRunner.java:72)
at common.hibernate.test.MultiCompanyTest.main(MultiCompanyTest.java:32)
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for model.AccountCurrency instance with identifier: 1
at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:502)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:671)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:641)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2336)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at common.hibernate._RootDAO.save(_RootDAO.java:345)
at common.hibernate.base.BaseAccountDAO.save(BaseAccountDAO.java:38)
at common.hibernate.test.MultiCompanyTest.testChartOfAccountDAO(MultiCompanyTest.java:126)
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 junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at junit.textui.TestRunner.run(TestRunner.java:72)
at common.hibernate.test.MultiCompanyTest.main(MultiCompanyTest.java:32)
Time: 9.406
|