/** * Locate the transaction manager * * @param throwExceptionIfUnableToLocate if true and transaction manager * cannot be located, a RuntimeException is thrown, otherwise null is * returned. * * @return the transaction manager */ public TransactionManager locate(boolean throwExceptionIfUnableToLocate) { if (tm != null) return tm; TransactionManager result = tryJNDI(); if (result == null) result = usePrivateAPI(); if (result == null && throwExceptionIfUnableToLocate) throw new RuntimeException("Unable to locate the transaction manager"); return result; }
/** * Locate the transaction manager * * @param throwExceptionIfUnableToLocate if true and transaction manager * cannot be located, a RuntimeException is thrown, otherwise null is * returned. * * @return the transaction manager */ public TransactionManager locate(boolean throwExceptionIfUnableToLocate) { if (tm != null) return tm; TransactionManager result = tryJNDI(); if (result == null) result = usePrivateAPI(); if (result == null && throwExceptionIfUnableToLocate) throw new RuntimeException("Unable to locate the transaction manager"); return result; }