[
https://issues.apache.org/jira/browse/JENA-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15054986#comment-15054986
]
ASF GitHub Bot commented on JENA-1085:
--------------------------------------
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!
> Review transaction finishes for DatasetGraphInMemory
> ----------------------------------------------------
>
> Key: JENA-1085
> URL: https://issues.apache.org/jira/browse/JENA-1085
> Project: Apache Jena
> Issue Type: Task
> Components: ARQ
> Affects Versions: Jena 3.0.1
> Reporter: Andy Seaborne
> Assignee: Andy Seaborne
> Fix For: Jena 3.1.0
>
>
> This JIRA is for a review of the transaction finishing code.
> Some of the code works because of the nature of specific implementations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)