I have a user transaction set up similar to this:
UserTransaction transaction = getTransactionService().getNonPropagatingUserTransaction();
try {
transaction.setTransactionTimeout(60);
transaction.begin();
long start = System.currentTimeMillis();
Object responseObj = executeWS(request, response);
if (responseObj != null) {
writeResponseObjectToResponse(request, response, responseObj);
}else {
response.getWriter().write("");
}
long end = System.currentTimeMillis();
transaction.commit();
if (LOGGER.isInfoEnabled()) {
double time = (end - start) / 1000.0;
LOGGER.info(String.format("Transaction complete after %.2f seconds.", time));
}
} catch(Exception e) {
try {
transaction.rollback();
} catch (SystemException se) {
throw new WebScriptException("Error during rollback.", se);
}
throw new WebScriptException("Error executing Web Script " + getDescription() + ".", e);
}
The transaction does not timeout before the 60 second limit. Is timeout enabled in Alfresco's implementation? Is there something else I could use to timeout and rollback the transaction?I realize that timing out a running transaction is not an ideal solution but it is what I'v been ordered to do.