Github user kinow commented on a diff in the pull request:
https://github.com/apache/jena/pull/459#discussion_r209416344
--- Diff:
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
---
@@ -270,30 +269,50 @@ public boolean isTransactional() {
return isTransactional ;
}
- public void beginRead() {
- activeMode = READ ;
- transactional.begin(READ) ;
+ public void begin(TxnType txnType) {
+ transactional.begin(txnType);
activeDSG = dsg ;
- dataService.startTxn(READ) ;
+ dataService.startTxn(txnType) ;
+ }
+
+ public void begin() {
+ begin(READ_PROMOTE);
+ }
+
+ public void beginWrite() {
+ begin(WRITE);
+ }
+
+ public void beginRead() {
+ begin(READ);
}
public void endRead() {
- dataService.finishTxn(READ) ;
- activeMode = null ;
+ dataService.finishTxn() ;
+ transactional.commit();
transactional.end() ;
activeDSG = null ;
}
- public void beginWrite() {
- transactional.begin(WRITE) ;
- activeMode = WRITE ;
- activeDSG = dsg ;
- dataService.startTxn(WRITE) ;
+ public void end() {
+ dataService.finishTxn() ;
+
+ if ( transactional.isInTransaction() ) {
+ Log.warn(this, "Transaction still active - no commit or abort
seen (forced abort)") ;
+ try {
+ transactional.abort() ;
+ } catch (RuntimeException ex) {
+ Log.warn(this, "Exception in forced abort (trying to
continue)", ex) ;
+ }
+ }
+ transactional.end() ;
+ activeDSG = null ;
}
-
+
--- End diff --
Nit-pick, unnecessary spaces?
---