Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/108#discussion_r47445019
  
    --- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/core/mem/DatasetGraphInMemory.java
 ---
    @@ -125,57 +115,104 @@ public DatasetGraphInMemory(final QuadTable i, final 
TripleTable t) {
     
         @Override
         public void begin(final ReadWrite readWrite) {
    -        if (isInTransaction()) throw new 
JenaTransactionException("Transactions cannot be nested!");
    -        transactionType(readWrite);
    -        isInTransaction(true);
    -        writeLock().enterCriticalSection(readWrite.equals(READ)); // get 
the dataset write lock, if needed.
    -        commitLock().readLock().lock(); // if a commit is proceeding, wait 
so that we see a coherent index state
    -        try {
    +        if (isInTransaction()) 
    +            throw new JenaTransactionException("Transactions cannot be 
nested!");
    +        startTransaction(readWrite) ;
    +        _begin(readWrite) ;
    +    }
    +
    +    private void _begin(ReadWrite readWrite) {
    +        withLock(systemLock, () ->{
    --- End diff --
    
    Nice idiom!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to