public void doRollback(RDFBeanTransaction txn) { txn.rollback(); } }
private void doRollback(RDFBeanTransaction txn) { txn.rollback(); }
@Override public void rollback() { try { for (RDFBeanTransaction tx : transactions) { tx.rollback(); } } finally { connection.cleanUpAfterCommit(); } }
public SeedEntityImpl( Configuration configuration, SessionFactory sessionFactory, List<Object> entities) throws IOException { this.persisted = new HashMap<Object, Object>(entities.size()); Session session = sessionFactory.openSession(); RDFBeanTransaction tx = session.beginTransaction(); try { for (Object entity : entities) { replaceReferences(configuration, entity); Object original = session.getByExample(entity); if (original == null) { session.save(entity); } else { persisted.put(entity, original); } } tx.commit(); } catch (Exception e) { logger.error(e.getMessage(), e); tx.rollback(); } finally { session.close(); } }
@Override public void evaluate() throws Throwable { Session session = SessionUtil.openSession(repository, new Locale("fi"), config.value()); RDFBeanTransaction tx = transactional ? session.beginTransaction() : null; try { Field field = target.getClass().getField("session"); field.setAccessible(true); field.set(target, session); base.evaluate(); } finally { if (tx != null) { tx.rollback(); } session.close(); } } };
@Override public <RT> RT execute(RDFConnectionCallback<RT> operation) { RDFConnection connection = openConnection(); try{ RDFBeanTransaction tx = connection.beginTransaction(false, RDFBeanTransaction.TIMEOUT, RDFBeanTransaction.ISOLATION); try{ RT retVal = operation.doInConnection(connection); tx.commit(); return retVal; }catch(IOException io){ tx.rollback(); throw new RepositoryException(io); } }finally{ connection.close(); } }
@Override public <RT> RT execute(RDFConnectionCallback<RT> operation) { RDFConnection connection = openConnection(); try { RDFBeanTransaction tx = connection.beginTransaction(false, RDFBeanTransaction.TIMEOUT, RDFBeanTransaction.ISOLATION); try { RT retVal = operation.doInConnection(connection); tx.commit(); return retVal; } catch (IOException io) { tx.rollback(); throw new RepositoryException(io); } } finally { connection.close(); } }
@Override public <RT> RT execute(RDFConnectionCallback<RT> operation) { RDFConnection connection = openConnection(); try { RDFBeanTransaction tx = connection.beginTransaction(false, RDFBeanTransaction.TIMEOUT, RDFBeanTransaction.ISOLATION); try { RT retVal = operation.doInConnection(connection); tx.commit(); return retVal; } catch (IOException io) { tx.rollback(); throw new RepositoryException(io); } } finally { connection.close(); } }
tx.rollback(); } catch (RuntimeException oe) { throw new TransactionSystemException("error rolling back transaction", oe);