db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: Multithreaded query test fails
Date Thu, 09 Jun 2005 14:03:57 GMT
Hi Craig,

I can reproduce the exception.

The exception is thrown because the call "super.executeQueries(pm)" in 
method 
"ExecutingMultipleQueriesSimultaneouslyIsThreadSafe.executeQueries(PersistenceManager" 
is not executed inside a transaction. If you add begin/commit the test 
succeeds.

However, I think it is better to move the transaction inside method 
"MultipleActiveQueryInstanceInSamePersistenceManager.executeQueries(PersistenceManager)" 
   which is the super method. That method is called only classes 
"MultipleActiveQueryInstanceInSamePersistenceManager" and 
"ExecutingMultipleQueriesSimultaneouslyIsThreadSafe".

That means a patch would only change class 
"MultipleActiveQueryInstanceInSamePersistenceManager" instead of 
"ExecutingMultipleQueriesSimultaneouslyIsThreadSafe". It would add 
begin/commit calls in method "executeQueries(PersistenceManager)" and 
remove begin/commit calls in method 
"runTestMultipleActiveQueryInstanceInSamePersistenceManager(PersistenceManager)" 
which calls "executeQueries(PersistenceManager)".

Attached you find this patch.

Regards,
Michael

> Hi Michael,
> 
> Could you take a look at this test failure? There is nothing obvious  in 
> the test. It's a tricky test and I couldn't tell  you if it is valid.
> 
> Thanks,
> 
> Craig
> 
> 11) test 
> (org.apache.jdo.tck.query.ExecutingMultipleQueriesSimultaneouslyIsThread 
> Safe)junit.framework.AssertionFailedError: Assertion A14.3-2  
> (ExecutingMultipleQueriesSimultaneouslyIsThreadSafe) failed:
>     [java] Thread Thread[ThreadID-3,5,]: uncaught exception  
> org.jpox.exceptions.TransactionNotActiveException: Transaction is not  
> active. You either need to define a transaction around this, or run  
> your PersistenceManagerFactory with 'NontransactionalRead' set to 'true'
>     [java]      at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:510)
>     [java]      at  
> org.apache.jdo.tck.query.ExecutingMultipleQueriesSimultaneouslyIsThreadS 
> afe.executeMultipleQueries 
> (ExecutingMultipleQueriesSimultaneouslyIsThreadSafe.java:123)
>     [java]      at  
> org.apache.jdo.tck.query.ExecutingMultipleQueriesSimultaneouslyIsThreadS 
> afe.test(ExecutingMultipleQueriesSimultaneouslyIsThreadSafe.java:70)
>     [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native 
> Method)
>     [java]      at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:39)
>     [java]      at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:25)
>     [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java: 181)
>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.start 
> (BatchTestRunner.java:112)
>     [java]      at org.apache.jdo.tck.util.BatchTestRunner.main 
> (BatchTestRunner.java:90)
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 
> 


-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message