protected void endTransaction(MessageContext msgContext,
boolean commit) throws AxisFault {
Object tx =
msgContext.getProperty(Constants.TRANSACTION_PROPERTY);
if (tx != null) {
try {
if (commit) {
userTransaction.commit();
} else {
userTransaction.rollback();
}
} catch(RollbackException e) {
throw new AxisFault("Could not rollback tx.",e);
} catch(SystemException e) {
throw new AxisFault("Could not influence tx setting.",e);
} catch(HeuristicMixedException e) {
throw new AxisFault("Could not commit tx.",e);
} catch(HeuristicRollbackException e) {
throw new AxisFault("Could not commit tx.",e);
} finally {
msgContext.setProperty(Constants.TRANSACTION_PROPERTY, null);
}
}
}
|