public void run(RepositoryConnection con) throws RepositoryException { con.rollback(); } });
protected void rollbackInternal() throws SailException { try { repoConnection.rollback(); } catch (RepositoryException e) { throw new SailException(e); } }
public void run(RepositoryConnection con) throws RepositoryException { con.rollback(); con.setAutoCommit(true); } });
@Override public void rollback() { try { connection.getConnection().rollback(); } catch (StoreException e) { String error = "Caught " + e.getClass().getName(); logger.error(error, e); throw new RepositoryException(error, e); }finally{ connection.cleanUpAfterRollback(); } }
@Override public void rollback() { try { connection.getConnection().rollback(); } catch (StoreException e) { String error = "Caught " + e.getClass().getName(); logger.error(error, e); throw new RepositoryException(error, e); } finally { connection.cleanUpAfterRollback(); } }
@Override public void rollback() { try { connection.getConnection().rollback(); } catch (org.openrdf.repository.RepositoryException e) { String error = "Caught " + e.getClass().getName(); logger.error(error, e); throw new RepositoryException(error, e); } finally { connection.cleanUpAfterRollback(); } }
public void close(boolean success) throws RepositoryException { if (success) { connection.commit(); } else { connection.rollback(); } connection.close(); }
public void close(boolean success) throws RepositoryException { if (success) { connection.commit(); } else { connection.rollback(); } connection.close(); }
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 synchronized void rollback() { if(!isLocked()) { return; } assertModel(); try { this.connection.rollback(); } catch(RepositoryException e) { throw new ModelRuntimeException(e); } }
public synchronized void rollback() { if (!isLocked()) { return; } assertModel(); try { connection.rollback(); } catch (RepositoryException e) { throw new ModelRuntimeException(e); } }
private void reader(final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, InterruptedException { query(conn); // Thread.sleep(100); query(conn); ++counter; if (counter % 3 == 0) conn.commit(); else conn.rollback(); // if (counter % 7 == 0) { // conn.close(); // conn = repo.getConnection(); // conn.setAutoCommit(false); // } }
@Test public void testEmptyRollback() throws Exception { assertThat(testCon.isEmpty(), is(equalTo(true))); assertThat(testCon2.isEmpty(), is(equalTo(true))); testCon.begin(); testCon.add(vf.createBNode(), vf.createURI(URN_PRED), vf.createBNode()); assertThat(testCon.isEmpty(), is(equalTo(false))); assertThat(testCon2.isEmpty(), is(equalTo(true))); testCon.rollback(); assertThat(testCon.isEmpty(), is(equalTo(true))); assertThat(testCon2.isEmpty(), is(equalTo(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); }
@Test public void testRollback() throws Exception { testCon.begin(); 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)); }
@Test public void testEmptyRollback() throws Exception { assertThat(testCon.isEmpty(), is(equalTo(true))); assertThat(testCon2.isEmpty(), is(equalTo(true))); testCon.begin(); testCon.add(vf.createBNode(), vf.createURI(URN_PRED), vf.createBNode()); assertThat(testCon.isEmpty(), is(equalTo(false))); assertThat(testCon2.isEmpty(), is(equalTo(true))); testCon.rollback(); assertThat(testCon.isEmpty(), is(equalTo(true))); assertThat(testCon2.isEmpty(), is(equalTo(true))); }
@Override public void remove(ID subject, UID predicate, NODE object, UID context) { Resource subj = subject != null ? dialect.getResource(subject) : null; URI pred = predicate != null ? dialect.getURI(predicate) : null; Value obj = object != null ? dialect.getNode(object) : null; URI cont = context != null ? dialect.getURI(context) : null; try { connection.remove(subj, pred, obj, cont); } catch (org.openrdf.repository.RepositoryException e) { try { connection.rollback(); } catch (org.openrdf.repository.RepositoryException e1) { throw new RepositoryException(e); } throw new RepositoryException(e); } }
private void addDummyData(final Sail sail) throws Exception { Repository repo = new SailRepository(sail); RepositoryConnection rc = repo.getConnection(); try { rc.begin(); rc.add(RippleSail.class.getResource("rippleSailTest.trig"), "", RDFFormat.TRIG); rc.commit(); } finally { rc.rollback(); rc.close(); } } }
@Test public void testRollback() throws Exception { testCon.begin(); 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)); }
public void testEmptyRollback() 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.rollback(); assertTrue(testCon.isEmpty()); assertTrue(testCon2.isEmpty()); }