use of org.bimserver.database.actions.CommitTransactionDatabaseAction in project BIMserver by opensourceBIM.
the class LowLevelServiceImpl method commitTransaction.
@Override
public Long commitTransaction(Long tid, String comment) throws UserException, ServerException {
requireAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
LongTransaction longTransaction = getBimServer().getLongTransactionManager().get(tid);
if (longTransaction == null) {
throw new UserException("No transaction with tid " + tid + " was found");
}
CommitTransactionDatabaseAction action = new CommitTransactionDatabaseAction(getBimServer(), session, getInternalAccessMethod(), getAuthorization(), longTransaction, comment);
try {
session.executeAndCommitAction(action);
return action.getRevision().getOid();
} catch (BimserverDatabaseException e) {
LOGGER.error("", e);
} finally {
session.close();
}
} catch (NoTransactionException e) {
LOGGER.error("", e);
}
return -1L;
}
Aggregations