/** * Returns the TransactionManager * @return */ private TransactionManager getTransactionManager() { if (this.transactionManager == null) { this.transactionManager = TxUtil.getTransactionManager(); } return this.transactionManager; } }
public SessionSynchronizationInterceptor() { this.tm = TxUtil.getTransactionManager(); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this.tm = TxUtil.getTransactionManager(); }
public UserTransactionImpl() { if (log.isDebugEnabled()) log.debug("new UserTx: " + this); this.tm = TxUtil.getTransactionManager(); }
public static void setRollbackOnly() { check("setRollbackOnly", "EJB 3.0 FR 13.6.2.8"); try { TransactionManager tm = TxUtil.getTransactionManager(); // The getRollbackOnly and setRollBackOnly method of the SessionContext interface should be used // only in the session bean methods that execute in the context of a transaction. if (tm.getTransaction() == null) throw new IllegalStateException("setRollbackOnly() not allowed without a transaction."); tm.setRollbackOnly(); } catch (SystemException e) { log.warn("failed to set rollback only; ignoring", e); } } }
TransactionManager tm = TxUtil.getTransactionManager();
private void cleanExtendedPCs() { try { Transaction tx = TxUtil.getTransactionManager().getTransaction(); if (tx != null && TxUtils.isActive(tx)) { tx.registerSynchronization(new XPCCloseSynchronization(this)); } else { closeExtendedPCs(); } } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException("Error cleaning PersistenceContexts in SFSB removal", e); } }
public Object invoke(Invocation invocation) throws Throwable { log.debug("++++ LongLivedSessionPropagationInterceptor"); StatefulContainerInvocation ejb = (StatefulContainerInvocation) invocation; StatefulBeanContext ctx = (StatefulBeanContext) ejb.getBeanContext(); Map<String, EntityManager> extendedPCs = ctx.getExtendedPersistenceContexts(); if (extendedPCs == null || extendedPCs.size() == 0) { return invocation.invokeNext(); } TransactionManager tm = TxUtil.getTransactionManager(); if (tm.getTransaction() != null) { for (String kernelname : extendedPCs.keySet()) { EntityManager manager = extendedPCs.get(kernelname); ManagedEntityManagerFactory factory = ManagedEntityManagerFactoryHelper.getManagedEntityManagerFactory(kernelname); factory.registerExtendedWithTransaction(manager); } } return invocation.invokeNext(); } }
tm = TxUtil.getTransactionManager(); //getContainer(mi).getTransactionManager(); currentTx = tm.getTransaction(); tm = TxUtil.getTransactionManager(); //getContainer(mi).getTransactionManager(); tm.resume(suspended);
TransactionManager tm = TxUtil.getTransactionManager(); //container.getTransactionManager(); suspended = tm.suspend();
public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { // We have to do this until AOP supports matching based on annotation attributes TransactionManagementType type = TxUtil.getTransactionManagementType(advisor); if (type != TransactionManagementType.BEAN) return new NullInterceptor(); TransactionManager tm = TxUtil.getTransactionManager(); boolean stateful = advisor.resolveAnnotation(Stateful.class) != null; // Both MessageDriven and Stateless are stateless if(stateful) return new StatefulBMTInterceptor(tm); else return new StatelessBMTInterceptor(tm); } }
try tx = TxUtil.getTransactionManager().getTransaction();