// START TRANSACTION
try {
orgSession.getSessionManager().beginTransaction();
} catch (DfException e) {
monitor.log().debug(e);
throw new CaoException(e);
}
}
try {
session = orgSession.getSessionManager().getSession(orgSession.getDocbaseName());
if (useTransaction) {
monitor.log().debug("Commit transaction");
session.getSessionManager().release(session);
orgSession.getSessionManager().commitTransaction();
}
} catch (Throwable t) {
monitor.log().error(t);
if (session!=null) session.getSessionManager().release(session);
if (useTransaction) {
monitor.log().debug("Abort transaction");
try {
orgSession.getSessionManager().abortTransaction();
} catch (DfException e) {
monitor.log().debug(e);
throw new CaoException(e);
}
}
}