public TransactionInternal startJTSTx(JavaEETransaction tran, boolean isAssociatedTimeout)
throws RollbackException, IllegalStateException, SystemException {
setTransactionManager();
JavaEETransactionImpl tx = (JavaEETransactionImpl)tran;
try {
if (isAssociatedTimeout) {
// calculate the timeout for the transaction, this is required as the local tx
// is getting converted to a global transaction
int timeout = tx.cancelTimerTask();
int newtimeout = (int) ((System.currentTimeMillis() - tx.getStartTime()) / 1000);
newtimeout = (timeout - newtimeout);
beginJTS(newtimeout);
} else {
beginJTS(((JavaEETransactionManagerSimplified)javaEETM).getEffectiveTimeout());
}