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.
    



---

Reply via email to