[
https://issues.apache.org/jira/browse/JENA-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437290#comment-13437290
]
Andy Seaborne commented on JENA-299:
------------------------------------
Your test case had two oddities:
1/ Call QueryExecution after .commit()
As it was create inside a transaction, it should be only manipulated inside.
2/ Repeated TDBFactory.createDataset(this.location) - it is a bit cheaper to
use the same Dataset.
As the internal structures are cached-per-location, this is a minor saving but
better represents how it works. A dataset can be used on multiple therads,
with multiple transactions, one per thread.
> LeaveCriticalSection Error
> --------------------------
>
> Key: JENA-299
> URL: https://issues.apache.org/jira/browse/JENA-299
> Project: Apache Jena
> Issue Type: Bug
> Components: TDB
> Affects Versions: TDB 0.9.4
> Environment: windows 64 bit
> Reporter: Simon Helsen
> Assignee: Andy Seaborne
> Priority: Critical
> Fix For: TDB 0.9.4
>
> Attachments: LeaveCriticalSectionTestCase.zip
>
>
> I have attached a standalone test case, which, when run with the latest
> snapshot produces the following exception:
> Exception in thread "main" com.hp.hpl.jena.shared.JenaException:
> leaveCriticalSection: No lock held (main) Thread R/W: 0/0 :: Model R/W: 0/0
> (thread: main)
> at
> com.hp.hpl.jena.shared.LockMRSW.leaveCriticalSection(LockMRSW.java:175)
> at
> com.hp.hpl.jena.tdb.transaction.TransactionManager$TSM_WriteBackEndTxn.readerFinishes(TransactionManager.java:210)
> at
> com.hp.hpl.jena.tdb.transaction.TransactionManager.readerFinishes(TransactionManager.java:723)
> at
> com.hp.hpl.jena.tdb.transaction.TransactionManager.noteTxnAbort(TransactionManager.java:587)
> at
> com.hp.hpl.jena.tdb.transaction.TransactionManager.notifyAbort(TransactionManager.java:445)
> at
> com.hp.hpl.jena.tdb.transaction.Transaction.abort(Transaction.java:162)
> at
> com.hp.hpl.jena.tdb.transaction.DatasetGraphTxn.abort(DatasetGraphTxn.java:45)
> at
> com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction._abort(DatasetGraphTransaction.java:156)
> at
> com.hp.hpl.jena.tdb.migrate.DatasetGraphTrackActive.abort(DatasetGraphTrackActive.java:68)
> at com.hp.hpl.jena.sparql.core.DatasetImpl.abort(DatasetImpl.java:149)
> at
> com.ibm.jena.test.LeaveCriticalSectionErrorTest.storeOperation(LeaveCriticalSectionErrorTest.java:57)
> at
> com.ibm.jena.test.LeaveCriticalSectionErrorTest.query1(LeaveCriticalSectionErrorTest.java:105)
> at
> com.ibm.jena.test.LeaveCriticalSectionErrorTest.main(LeaveCriticalSectionErrorTest.java:156)
> The sequence in the test case is to run 2 queries, 1 write and then again 2
> queries:
> test.query1();
> test.query1();
> test.write1();
> test.query1();
> test.query1();
> Somehow, the following sequence did not produce the exception:
> test.query1();
> test.query1();
> test.write1();
> test.query1();
> Note that the test case does not check the correctness of any results.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira