timeoutTimestamp = System.currentTimeMillis() + (defaultTransactionTimeout * MILLISECOND_PER_SECOND);
transactionToTimeoutMap.put(transaction, timeoutTimestamp);
}
if (timeoutTimestamp <= System.currentTimeMillis()) {
throw new TransactionTimeoutException("transaction timed out");
}
return timeoutTimestamp - System.currentTimeMillis();
} catch (SystemException e) {
throw new TransactionException("cannot get the current transaction", e);