return work.execute();
}
catch(Exception e)
{
log.warn(exceptionLogMessage(work), e);
throw new ExecutionError(e);
}
}
log.info("Executing " + work + ".");
Session session = session();
currentSession.set(session);
currentUnitOfWork.set(work);
session.beginTransaction();
try
{
T result = null;
try
{
result = work.execute();
}
catch(Exception e)
{
log.warn(exceptionLogMessage(work), e);
Transaction tx = getActiveTransaction(session);
if(tx != null)
tx.rollback();
throw new ExecutionError(e);
}
Transaction tx = getActiveTransaction(session);
if(tx != null)
tx.commit();