private static void addHandler(Map<Object, TransactionHandler> handlers, Graph graph) { TransactionHandler th = graph.getTransactionHandler(); if ( ! th.transactionsSupported() ) return; Object key = calcKey(graph); if ( th.transactionsSupported() ) handlers.put(key, th) ; }
@Override public boolean supportsTransactions() { return getTransactionHandler().transactionsSupported(); }
@Override public boolean transactionsSupported() { return getBaseHandler().transactionsSupported(); }
@Override public boolean supportsTransactions() { return getTransactionHandler().transactionsSupported(); }
private boolean supportsTransactions(Graph graph) { return (graph.getTransactionHandler() != null && graph.getTransactionHandler().transactionsSupported()); }
private void beginTransaction(SDBConnection sdbConn) { if (sdbConn.getTransactionHandler().transactionsSupported()) { sdbConn.getTransactionHandler().begin(); } }
private void abortTransaction(SDBConnection sdbConn) { if (sdbConn.getTransactionHandler().transactionsSupported()) { sdbConn.getTransactionHandler().abort(); } }
public void testExecuteInTransactionCatchesThrowable() { Graph g = getGraph(); TransactionHandler th = g.getTransactionHandler(); if (th.transactionsSupported()) { try { th.execute( ()-> { throw new Error() ; } ); } catch (JenaException x) {} } }
public void testExecuteInTransactionCatchesThrowable() { Graph g = getGraph(); TransactionHandler th = g.getTransactionHandler(); if (th.transactionsSupported()) { try { th.execute( ()-> { throw new Error() ; } ); } catch (JenaException x) {} } }
public static void txnRun( Graph g, Runnable r ) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().execute( r ); } else { r.run(); } }
public static void txnRun( Graph g, Runnable r ) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().execute( r ); } else { r.run(); } }
/** * Commit the transaction on the graph if transactions are supported. * * @param g */ public static void txnCommit(Graph g) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().commit(); } }
/** * Rollback (abort) the transaction on the graph if transactions are * supported. * * @param g */ public static void txnRollback(Graph g) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().abort(); } } }
/** * Commit the transaction on the graph if transactions are supported. * * @param g */ public static void txnCommit(Graph g) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().commit(); } }
/** * Begin a transaction on the graph if transactions are supported. * * @param g */ public static void txnBegin(Graph g) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().begin(); } }
/** * Begin a transaction on the graph if transactions are supported. * * @param g */ public static void txnBegin(Graph g) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().begin(); } }
/** * Rollback (abort) the transaction on the graph if transactions are * supported. * * @param g */ public static void txnRollback(Graph g) { if (g.getTransactionHandler().transactionsSupported()) { g.getTransactionHandler().abort(); } } }
@Test public void graphDSG_view_txn_1() { DatasetGraph dsg = DatasetGraphFactory.createTxnMem(); Graph graph = dsg.getDefaultGraph(); assertTrue(graph instanceof GraphView); assertTrue(graph.getTransactionHandler().transactionsSupported()); }
@Test public void graphDSG_view_txn_2() { DatasetGraph dsg = DatasetGraphFactory.createGeneral(); // NOT dsg.getDefaultGraph() Graph graph = GraphView.createDefaultGraph(dsg); assertTrue( graph instanceof GraphView ); assertFalse(graph.getTransactionHandler().transactionsSupported()); }
private static void testInfModel(Dataset ds0) { Txn.executeWrite(ds0, ()->{}); Model baseModel = ds0.getDefaultModel(); Model model = ModelFactory.createInfModel(RDFSRuleReasonerFactory.theInstance().create(null), baseModel); if ( model.getGraph().getTransactionHandler().transactionsSupported() ) { // InfModels do not support transactions per se - they particpate if includes in a suitabel dataset. model.begin(); long x = Iter.count(model.listStatements()); model.commit(); assertTrue(x > 10); } }