public void run(RepositoryConnection con) throws RepositoryException { con.setAutoCommit(false); } });
public void run(RepositoryConnection con) throws RepositoryException { con.setAutoCommit(true); } });
public void run(RepositoryConnection con) throws RepositoryException { con.rollback(); con.setAutoCommit(true); } });
@Override @Deprecated public void setAutocommit(boolean autocommit) { try { this.connection.setAutoCommit(autocommit); } catch(RepositoryException e) { throw new ModelRuntimeException(e); } }
public void setAutocommit(boolean autocommit) { try { this.connection.setAutoCommit(autocommit); } catch (RepositoryException e) { throw new ModelRuntimeException(e); } }
@Override public void setAutocommit(boolean autocommit) { assertModel(); try { connection.setAutoCommit(autocommit); } catch (RepositoryException e) { throw new RuntimeException(e); } }
public void testInferencerQueryDuringTransaction() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); assertTrue(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); testCon.setAutoCommit(true); }
public void begin() { try { if (isActive()) throw new IllegalStateException("Transaction already started"); conn.setAutoCommit(false); } catch (RepositoryException e) { throw new PersistenceException(e); } }
/** * @throws java.lang.Exception */ //@Before public void setUp() throws Exception { rep = createRepository(); con = rep.getConnection(); con.setAutoCommit(false); // f = rep.getValueFactory(); }
public void testInferencerUpdates() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); testCon.remove(bob, name, nameBob); testCon.setAutoCommit(true); assertFalse(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); }
public void rollback() { try { if (!isActive()) throw new IllegalStateException("Transaction has not been started"); conn.rollback(); conn.setAutoCommit(true); rollbackOnly = false; } catch (RepositoryException e) { throw new PersistenceException(e); } }
public void commit() { try { if (!isActive()) throw new IllegalStateException("Transaction has not been started"); conn.commit(); conn.setAutoCommit(true); rollbackOnly = false; } catch (RepositoryException e) { throw new RollbackException(e); } }
public void testSubClassInference() throws Exception { testCon.setAutoCommit(false); testCon.add(woman, RDFS.SUBCLASSOF, person); testCon.add(man, RDFS.SUBCLASSOF, person); testCon.add(alice, RDF.TYPE, woman); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(alice, RDF.TYPE, person, true)); }
public void testRollback() throws Exception { testCon.setAutoCommit(false); testCon.add(alice, name, nameAlice); assertTrue("Uncommitted updates should be visible to own connection", testCon.hasStatement(alice, name, nameAlice, false)); testCon.rollback(); assertFalse("Repository should not contain statement after rollback", testCon.hasStatement(alice, name, nameAlice, false)); testCon.setAutoCommit(true); }
public void testAutoCommit() throws Exception { testCon.setAutoCommit(false); testCon.add(alice, name, nameAlice); assertTrue("Uncommitted update should be visible to own connection", testCon.hasStatement(alice, name, nameAlice, false)); testCon.commit(); assertTrue("Repository should contain statement after commit", testCon.hasStatement(alice, name, nameAlice, false)); testCon.setAutoCommit(true); }
public void testMakeExplicit() throws Exception { testCon.setAutoCommit(false); testCon.add(woman, RDFS.SUBCLASSOF, person); testCon.add(alice, RDF.TYPE, woman); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(alice, RDF.TYPE, person, true)); testCon.add(alice, RDF.TYPE, person); assertTrue(testCon.hasStatement(alice, RDF.TYPE, person, true)); }
public void testInferencerTransactionIsolation() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); assertTrue(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); assertFalse(testCon2.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); assertTrue(testCon2.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); } }
/** * @throws java.lang.Exception */ //@Before public void setUp() throws Exception { rep = createRepository(); con = rep.getConnection(); con.setAutoCommit(false); // f = rep.getValueFactory(); }
public void testTransactionIsolation() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); assertTrue(testCon.hasStatement(bob, name, nameBob, false)); assertFalse(testCon2.hasStatement(bob, name, nameBob, false)); testCon.commit(); assertTrue(testCon.hasStatement(bob, name, nameBob, false)); assertTrue(testCon2.hasStatement(bob, name, nameBob, false)); }
public void testEmptyCommit() throws Exception { assertTrue(testCon.isEmpty()); assertTrue(testCon2.isEmpty()); testCon.setAutoCommit(false); testCon.add(vf.createBNode(), vf.createURI("urn:pred"), vf.createBNode()); assertFalse(testCon.isEmpty()); assertTrue(testCon2.isEmpty()); testCon.commit(); assertFalse(testCon.isEmpty()); assertFalse(testCon2.isEmpty()); }