When this method returns it is guaranteed that {@link #isTransactionActive()} will returnfalse, regardless of the success of the rollback operation.
123124125126127128129130131132133
try { session.issue(new Command<Void>() { @Override public Void execute(ISession session, SeConnection connection) throws SeException, IOException { session.rollbackTransaction(); // and keep editing session.startTransaction(); return null; } });
271272273274275276277278279280281
} try { session.startTransaction(); } catch (IOException e) { try { session.rollbackTransaction(); } finally { session.dispose(); } throw new DataSourceException("Exception initiating transaction on " + session, e);
11291130113111321133113411351136113711381139
} catch (Exception e) { e.printStackTrace(); } finally { if (!commited) { transSession.rollbackTransaction(); } transSession.dispose(); // conn.close(); closed at tearDown } }