You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by afs <gi...@git.apache.org> on 2018/01/30 11:55:21 UTC
[GitHub] jena pull request #349: Cleanup comments and code around txn
GitHub user afs opened a pull request:
https://github.com/apache/jena/pull/349
Cleanup comments and code around txn
* Comment that is out of date
* Code that has legacy use only
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/afs/jena txn-cleanup
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/349.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #349
----
commit 90698b24de18060c291a66267c509a16e90a33ac
Author: Andy Seaborne <an...@...>
Date: 2018-01-30T11:53:29Z
Cleanup comments and code around txn
----
---
[GitHub] jena pull request #349: Cleanup comments and code around txn
Posted by ajs6f <gi...@git.apache.org>.
Github user ajs6f commented on a diff in the pull request:
https://github.com/apache/jena/pull/349#discussion_r164806834
--- Diff: jena-tdb/src/main/java/org/apache/jena/tdb/store/GraphNonTxnTDB.java ---
@@ -32,25 +34,58 @@
* @see GraphTxnTDB
*/
public class GraphNonTxnTDB extends GraphTDB implements Closeable, Sync {
- private final DatasetGraphTDB dataset ;
+ private final DatasetGraphTDB dataset;
public GraphNonTxnTDB(DatasetGraphTDB dataset, Node graphName) {
- super(dataset, graphName) ;
- this.dataset = dataset ;
+ super(dataset, graphName);
+ this.dataset = dataset;
}
@Override
public DatasetGraphTDB getDatasetGraphTDB() {
- return dataset ;
+ return dataset;
}
@Override
protected DatasetGraphTDB getBaseDatasetGraphTDB() {
- return dataset ;
+ return dataset;
}
@Override
public TransactionHandler getTransactionHandler() {
- return new TransactionHandlerTDB(this) ;
+ return new TransactionHandlerTDB(this);
+ }
+
+ // Transaction handler for non-transactional use.
+ // Does not support transactions, but syncs on commit which is the best it
+ // can do without being transactional, which is striongly preferrerd.
+ // For backwards compatibility only.
+ private static class TransactionHandlerTDB extends TransactionHandlerBase //implements TransactionHandler
+ {
+ private final Graph graph;
+
+ public TransactionHandlerTDB(GraphTDB graph) {
+ this.graph = graph ;
+ }
+
+ @Override
+ public void abort() {
+ // Not the Jena old-style transaction interface
--- End diff --
Not quite sure what this comment means-- is there a specific type you are mentioning?
---
[GitHub] jena pull request #349: Cleanup comments and code around txn
Posted by afs <gi...@git.apache.org>.
Github user afs commented on a diff in the pull request:
https://github.com/apache/jena/pull/349#discussion_r165013487
--- Diff: jena-tdb/src/main/java/org/apache/jena/tdb/store/GraphNonTxnTDB.java ---
@@ -32,25 +34,58 @@
* @see GraphTxnTDB
*/
public class GraphNonTxnTDB extends GraphTDB implements Closeable, Sync {
- private final DatasetGraphTDB dataset ;
+ private final DatasetGraphTDB dataset;
public GraphNonTxnTDB(DatasetGraphTDB dataset, Node graphName) {
- super(dataset, graphName) ;
- this.dataset = dataset ;
+ super(dataset, graphName);
+ this.dataset = dataset;
}
@Override
public DatasetGraphTDB getDatasetGraphTDB() {
- return dataset ;
+ return dataset;
}
@Override
protected DatasetGraphTDB getBaseDatasetGraphTDB() {
- return dataset ;
+ return dataset;
}
@Override
public TransactionHandler getTransactionHandler() {
- return new TransactionHandlerTDB(this) ;
+ return new TransactionHandlerTDB(this);
+ }
+
+ // Transaction handler for non-transactional use.
+ // Does not support transactions, but syncs on commit which is the best it
+ // can do without being transactional, which is striongly preferrerd.
+ // For backwards compatibility only.
+ private static class TransactionHandlerTDB extends TransactionHandlerBase //implements TransactionHandler
+ {
+ private final Graph graph;
+
+ public TransactionHandlerTDB(GraphTDB graph) {
+ this.graph = graph ;
+ }
+
+ @Override
+ public void abort() {
+ // Not the Jena old-style transaction interface
--- End diff --
Comment removed.
Remember if the app gets to this code it is heaving for deep trouble!
For legacy reasons, touching the GraphTransactionHandler can't switch to transaction mode because the rest of the app is probably trying to work old-style, non-transactionally.
---
[GitHub] jena pull request #349: Cleanup comments and code around txn
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/jena/pull/349
---