throw (javax.transaction.SystemException) cause;
}
// convert to JTA exception
if (e instanceof HeuristicCompletionException) {
HeuristicCompletionException heuristicCompletionException = (HeuristicCompletionException) e;
if (heuristicCompletionException.getOutcomeState() == HeuristicCompletionException.STATE_MIXED) {
throw createJtaException(HeuristicMixedException.class, e);
} else if (heuristicCompletionException.getOutcomeState() == HeuristicCompletionException.STATE_ROLLED_BACK) {
throw createJtaException(HeuristicRollbackException.class, e);
}
} else if (e instanceof UnexpectedRollbackException) {
throw createJtaException(RollbackException.class, e);
}