protected void setTransactionalContext(Transaction tx, GlobalTransaction gtx, TransactionContext tCtx, InvocationContext ctx) { if (trace) { log.trace("Setting up transactional context."); log.trace("Setting tx as " + tx + " and gtx as " + gtx); } ctx.setTransaction(tx); ctx.setGlobalTransaction(gtx); if (tCtx == null) { if (gtx != null) { ctx.setTransactionContext(txTable.get(gtx)); } else if (tx == null) { // then nullify the transaction tCtx as well ctx.setTransactionContext(null); } } else { ctx.setTransactionContext(tCtx); } }
private void resumeTransactionOnCompletion(InvocationContext ctx, Transaction currentTx) throws SystemException, InvalidTransactionException { if (trace) log.trace("Resuming suspended transaction " + currentTx); txManager.suspend(); if (currentTx != null) { txManager.resume(currentTx); ctx.setTransaction(currentTx); } }
txManager.resume(ltx); ctx.setTransaction(ltx);
txManager.resume(ltx); ctx.setTransaction(ltx);
/** * Sets the state of the InvocationContext based on the template context passed in * * @param template template to copy from */ public void setState(InvocationContext template) { if (template == null) { throw new NullPointerException("Template InvocationContext passed in to InvocationContext.setState() passed in is null"); } this.setGlobalTransaction(template.getGlobalTransaction()); this.setLocalRollbackOnly(template.isLocalRollbackOnly()); this.setOptionOverrides(template.getOptionOverrides()); this.setOriginLocal(template.isOriginLocal()); this.setTransaction(template.getTransaction()); }