castor

Test1355 of new cpactf test suite fails on mysql and oracle

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.3 rc1
  • Fix Version/s: None
  • Component/s: JDO lazy loading
  • Labels:
    None
  • Number of attachments :
    0

Issue Links

Activity

Hide
Ralf Joachim added a comment -

Comparing the behaviour of 1.2 and 1.3rc1 I made a very interesting discovery.

  • When I execute test with 1.3rc1 after setting up the tables it fails.
  • When I execute test with 1.2 after setting up the tables it shows no failures.
  • When I execute test with 1.3rc1 after a successful run with 1.2 it also does not show failures with 1.3rc1.

This leaded me to take a look at the tables and compare the records after a test execution with 1.2 with the setup script. Unfortunately it apears that test at 1.2 modified the record with ID=1 of table test1355_golf_course where it sets CITY_ID to NULL. Therefore the test at 1.2 has never executed successful but instead modified records which it should not have done. In contrast behaviour of 1.3rc1 does not modify records but also does not show the expected behaviour.

According to the stacktrace it seams that the problem at hand is related to lazy loading of city entities.

org.exolab.castor.jdo.TransactionAbortedException: Nested error: org.exolab.castor.jdo.PersistenceException: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction
	at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1231)
	at org.exolab.castor.jdo.engine.LocalDatabaseImpl.commit(LocalDatabaseImpl.java:161)
	at org.castor.cpa.test.test1355.Test1355.testLoadLazyCollectionWithoutLazyOneToOne(Test1355.java:74)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	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:120)
	at org.castor.cpa.test.framework.CPATestCase.run(CPATestCase.java:139)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.exolab.castor.jdo.PersistenceException: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction
	at org.castor.persist.resolver.PersistanceCapableRelationResolver.preStore(PersistanceCapableRelationResolver.java:271)
	at org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java:742)
	at org.exolab.castor.persist.LockEngine.preStore(LockEngine.java:688)
	at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1202)
	... 21 more
Caused by: org.exolab.castor.jdo.PersistenceException: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction
	at org.castor.persist.resolver.PersistanceCapableRelationResolver.preStore(PersistanceCapableRelationResolver.java:271)
	at org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java:742)
	at org.exolab.castor.persist.LockEngine.preStore(LockEngine.java:688)
	at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1202)
	at org.exolab.castor.jdo.engine.LocalDatabaseImpl.commit(LocalDatabaseImpl.java:161)
	at org.castor.cpa.test.test1355.Test1355.testLoadLazyCollectionWithoutLazyOneToOne(Test1355.java:74)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	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:120)
	at org.castor.cpa.test.framework.CPATestCase.run(CPATestCase.java:139)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Show
Ralf Joachim added a comment - Comparing the behaviour of 1.2 and 1.3rc1 I made a very interesting discovery.
  • When I execute test with 1.3rc1 after setting up the tables it fails.
  • When I execute test with 1.2 after setting up the tables it shows no failures.
  • When I execute test with 1.3rc1 after a successful run with 1.2 it also does not show failures with 1.3rc1.
This leaded me to take a look at the tables and compare the records after a test execution with 1.2 with the setup script. Unfortunately it apears that test at 1.2 modified the record with ID=1 of table test1355_golf_course where it sets CITY_ID to NULL. Therefore the test at 1.2 has never executed successful but instead modified records which it should not have done. In contrast behaviour of 1.3rc1 does not modify records but also does not show the expected behaviour. According to the stacktrace it seams that the problem at hand is related to lazy loading of city entities.
org.exolab.castor.jdo.TransactionAbortedException: Nested error: org.exolab.castor.jdo.PersistenceException: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction
	at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1231)
	at org.exolab.castor.jdo.engine.LocalDatabaseImpl.commit(LocalDatabaseImpl.java:161)
	at org.castor.cpa.test.test1355.Test1355.testLoadLazyCollectionWithoutLazyOneToOne(Test1355.java:74)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	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:120)
	at org.castor.cpa.test.framework.CPATestCase.run(CPATestCase.java:139)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.exolab.castor.jdo.PersistenceException: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction
	at org.castor.persist.resolver.PersistanceCapableRelationResolver.preStore(PersistanceCapableRelationResolver.java:271)
	at org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java:742)
	at org.exolab.castor.persist.LockEngine.preStore(LockEngine.java:688)
	at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1202)
	... 21 more
Caused by: org.exolab.castor.jdo.PersistenceException: Object, org.castor.cpa.test.test1355.GolfCourse@bcda2d, links to another object, org.castor.cpa.test.test1355.City@1c05ffd that is not loaded/updated/created in this transaction
	at org.castor.persist.resolver.PersistanceCapableRelationResolver.preStore(PersistanceCapableRelationResolver.java:271)
	at org.exolab.castor.persist.ClassMolder.preStore(ClassMolder.java:742)
	at org.exolab.castor.persist.LockEngine.preStore(LockEngine.java:688)
	at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1202)
	at org.exolab.castor.jdo.engine.LocalDatabaseImpl.commit(LocalDatabaseImpl.java:161)
	at org.castor.cpa.test.test1355.Test1355.testLoadLazyCollectionWithoutLazyOneToOne(Test1355.java:74)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	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:120)
	at org.castor.cpa.test.framework.CPATestCase.run(CPATestCase.java:139)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Hide
Ralf Joachim added a comment -

It seams to me that both issues are about the same problem.

Show
Ralf Joachim added a comment - It seams to me that both issues are about the same problem.
Hide
Ralf Joachim added a comment -

Will comment out org.castor.cpa.test.test1355.Test1355 until this issue is resolved.

Show
Ralf Joachim added a comment - Will comment out org.castor.cpa.test.test1355.Test1355 until this issue is resolved.
Hide
Werner Guttmann added a comment -

Ralf, can you ckeck whether my patch to CASTOR-1409 changes anything ?

Show
Werner Guttmann added a comment - Ralf, can you ckeck whether my patch to CASTOR-1409 changes anything ?
Hide
Ralf Joachim added a comment -

The patch of CASTOR-1409 does not change anything for this issue. In other words: nothing changed.

Show
Ralf Joachim added a comment - The patch of CASTOR-1409 does not change anything for this issue. In other words: nothing changed.
Hide
Werner Guttmann added a comment -

I did half an hour of debugging yesterday on this, and so far I have not found anything that is going wrong. There's a few things I'd like to try, though, like e.g. disabling the Read-Only access mode when executing the query, etc.

Show
Werner Guttmann added a comment - I did half an hour of debugging yesterday on this, and so far I have not found anything that is going wrong. There's a few things I'd like to try, though, like e.g. disabling the Read-Only access mode when executing the query, etc.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: