Hi Bruce,
as far as I remember I got that failure at TC97 once after setting up
the test database. After executing:
update poly_owner set product=1;
on the mysql commandline client this problem disapeared and never
returned. At that time I thought that this may be a problem with the
mysql.sql script but after checking this right now I think there is
something going wrong with unidirectional relations to polymorph classes
as we have from owner to product.
The stacktrace of TC98 looks ok to me as we try to load the same object
in 2 independent threads which should lead to a Locking problems.
Loading the objects in a single thread works as you can see when
debuging through the other test cases.
Let's hear what Werner says when returned from holiday.
Regards
Ralf
Bruce Snyder schrieb:
On 7/18/05, Ralf Joachim <[EMAIL PROTECTED]> wrote:
I've commited the patch for issue CASTOR-1018 into CVS some days ago.
This patch adds support for polymorphism to CastorJDO. Even if
documentation is missing ATM it should be possible for you to test and
comment this great new feature mainly implemented by Werner. For
examples on how to use it you would have a look at the test cases in the
ctf.jdo.tc9x package.
While running the polymorphism tests individually, I am experiencing
some failures. Below are the results I'm seeing:
castor.mysql.TC94 - pass
castor.mysql.TC95 - pass
castor.mysql.TC97 - fail
castor.mysq.TC98 - fail
castor.mysql.TC99 - pass
Mind you, I have not looked into the failures yet. Below are the
exceptions I'm seeing:
There was 1 failure:
1) [castor.mysql.TC97] Polymorphism tests
junit.framework.AssertionFailedError
at
ctf.jdo.tc9x.TestPolymorphism.testLoadOwner(TestPolymorphism.java:366)
at ctf.jdo.tc9x.TestPolymorphism.runTest(TestPolymorphism.java:68)
at harness.CastorTestCase.run(CastorTestCase.java:154)
at harness.TestHarness.run(TestHarness.java:140)
at harness.TestHarness.run(TestHarness.java:140)
at Main.run(Main.java:152)
at Main.main(Main.java:226)
FAILURES!!!
Tests run: 1, Failures: 1, Errors: 0
Below is the failure for castor.mysql.TC98, even though there is no
official JUnit failure:
19 Jul 2005 10:25:30.734 [ERROR] [Thread-0]
[org.castor.persist.TransactionContext] - Caught exception while
rolling back object with OID ctf.jdo.tc9x.Container/200
java.lang.IllegalStateException: Transaction
[EMAIL PROTECTED] does not
hold the read lock: ctf.jdo.tc9x.Container/200/0 -/-!
at
org.exolab.castor.persist.LockEngine$TypeInfo.assure(LockEngine.java:1359)
at
org.exolab.castor.persist.LockEngine$TypeInfo.access$600(LockEngine.java:1064)
at
org.exolab.castor.persist.LockEngine.revertObject(LockEngine.java:880)
at
org.castor.persist.TransactionContext.rollback(TransactionContext.java:1800)
at
org.exolab.castor.jdo.engine.DatabaseImpl.rollback(DatabaseImpl.java:553)
at
ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment.loadContainer(TestPolymorphismInAThreadedEnvironment.java:71)
at
ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment$TreadedContainerLoader.run(TestPolymorphismInAThreadedEnvironment.java:159)
at java.lang.Thread.run(Thread.java:552)
19 Jul 2005 10:25:30.765 [ERROR] [Thread-0]
[org.castor.persist.TransactionContext] - Caught exception while
rolling back object with OID ctf.jdo.tc9x.Base/100
java.lang.IllegalStateException: Lock, ctf.jdo.tc9x.Base/100, doesn't
exist or no lock!
at
org.exolab.castor.persist.LockEngine$TypeInfo.assure(LockEngine.java:1357)
at
org.exolab.castor.persist.LockEngine$TypeInfo.access$600(LockEngine.java:1064)
at
org.exolab.castor.persist.LockEngine.revertObject(LockEngine.java:880)
at
org.castor.persist.TransactionContext.rollback(TransactionContext.java:1800)
at
org.exolab.castor.jdo.engine.DatabaseImpl.rollback(DatabaseImpl.java:553)
at
ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment.loadContainer(TestPolymorphismInAThreadedEnvironment.java:71)
at
ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment$TreadedContainerLoader.run(TestPolymorphismInAThreadedEnvironment.java:159)
at java.lang.Thread.run(Thread.java:552)
19 Jul 2005 10:25:30.768 [ERROR] [Thread-0]
[ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment] - Exception on
second thread loading Container on 1th try
java.lang.IllegalArgumentException: Transaction tx does not own this
lock, ctf.jdo.tc9x.Base/100/5 R/-!
at org.exolab.castor.persist.ObjectLock.setObject(ObjectLock.java:618)
at org.exolab.castor.persist.LockEngine.load(LockEngine.java:378)
at
org.castor.persist.TransactionContext.load(TransactionContext.java:716)
at
org.castor.persist.TransactionContext.load(TransactionContext.java:554)
at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:893)
at org.exolab.castor.persist.LockEngine.load(LockEngine.java:368)
at
org.castor.persist.TransactionContext.load(TransactionContext.java:716)
at
org.castor.persist.TransactionContext.load(TransactionContext.java:554)
at org.exolab.castor.jdo.engine.DatabaseImpl.load(DatabaseImpl.java:348)
at org.exolab.castor.jdo.engine.DatabaseImpl.load(DatabaseImpl.java:315)
at
ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment.loadContainer(TestPolymorphismInAThreadedEnvironment.java:68)
at
ctf.jdo.tc9x.TestPolymorphismInAThreadedEnvironment$TreadedContainerLoader.run(TestPolymorphismInAThreadedEnvironment.java:159)
at java.lang.Thread.run(Thread.java:552)
Time: 20.112
OK (1 test)
Bruce
--
Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Email: [EMAIL PROTECTED]
Web: www.syscon-world.de
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------