Returns in seconds duration till current transaction times out.
Returns negative value if transaction has already timedout.
Returns 0 if there is no timeout.
Returns 0 if any exceptions occur looking up remaining transaction timeout.
final String METHOD = "getRemainingTimeout";
int result = 0;
try {
result = javaeeTM.getTransactionRemainingTimeout();
} catch (IllegalStateException ise) {
if (logger.isLogging(Level.FINEST)) {
logger.finest(METHOD, "looking up remaining txn timeout, no current transaction", ise);
} else {
logger.info(METHOD, LocalizationMessages.TXN_MGR_OPERATION_FAILED_2008("getTransactionRemainingTimeout",
ise.getLocalizedMessage()));
}
} catch (Throwable t) {
if (logger.isLogging(Level.FINEST)) {
logger.finest(METHOD, "ignoring exception " + t.getClass().getName() + " thrown calling" +
"TM.getTransactionRemainingTimeout method" );
} else {
logger.info(METHOD, LocalizationMessages.TXN_MGR_OPERATION_FAILED_2008("getTransactionRemainingTimeout",
t.getLocalizedMessage()));
}
}
return result;