throws NotSupportedException, SystemException { int timeout = determineTimeout(definition); applyTimeout(txObject, timeout); txObject.getUserTransaction().begin(); if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) { try { Transaction tx = obtainTransactionManager().getTransaction(); Integer isolationLevel = definition.getIsolationLevel(); applyIsolationLevel(txObject, definition.getIsolationLevel());
private void loadWebLogicTransactionClasses() throws TransactionSystemException { try { Class<?> userTransactionClass = getClass().getClassLoader().loadClass(USER_TRANSACTION_CLASS_NAME); this.weblogicUserTransactionAvailable = userTransactionClass.isInstance(getUserTransaction()); if (this.weblogicUserTransactionAvailable) { this.beginWithNameMethod = userTransactionClass.getMethod("begin", String.class); logger.trace("WebLogic ClientTransactionManager found"); this.weblogicTransactionManagerAvailable = transactionManagerClass.isInstance(getTransactionManager()); if (this.weblogicTransactionManagerAvailable) { Class<?> transactionClass = getClass().getClassLoader().loadClass(TRANSACTION_CLASS_NAME);
@Override public void afterPropertiesSet() throws TransactionSystemException { super.afterPropertiesSet(); loadWebLogicTransactionClasses(); }
if (timeout >= 0) { Assert.state(this.beginWithNameAndTimeoutMethod != null, "WebLogic JTA API not initialized"); this.beginWithNameAndTimeoutMethod.invoke(getUserTransaction(), name, timeout); this.beginWithNameMethod.invoke(getUserTransaction(), name); throw new SystemException("Could not invoke WebLogic's UserTransaction.begin() method: " + ex); return new ManagedTransactionAdapter(obtainTransactionManager());
obtainTransactionManager().resume((Transaction) suspendedTransaction); this.forceResumeMethod.invoke(getTransactionManager(), suspendedTransaction);
applyTimeout(txObject, definition.getTimeout()); txObject.getUserTransaction().begin(); if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) { try { Transaction tx = getTransactionManager().getTransaction(); Integer isolationLevel = new Integer(definition.getIsolationLevel()); applyIsolationLevel(txObject, definition.getIsolationLevel());
private TransactionManager obtainTransactionManager() { TransactionManager tm = getTransactionManager(); Assert.state(tm != null, "No TransactionManager set"); return tm; }
@Override @Nullable protected TransactionManager retrieveTransactionManager() throws TransactionSystemException { Object helper = loadWebLogicTransactionHelper(); try { logger.trace("Retrieving JTA TransactionManager from WebLogic TransactionHelper"); Method getTransactionManagerMethod = helper.getClass().getMethod("getTransactionManager"); return (TransactionManager) getTransactionManagerMethod.invoke(this.transactionHelper); } catch (InvocationTargetException ex) { throw new TransactionSystemException( "WebLogic's TransactionHelper.getTransactionManager() method failed", ex.getTargetException()); } catch (Exception ex) { throw new TransactionSystemException( "Could not invoke WebLogic's TransactionHelper.getTransactionManager() method", ex); } }
obtainTransactionManager().resume((Transaction) suspendedTransaction); this.forceResumeMethod.invoke(getTransactionManager(), suspendedTransaction);
if (timeout >= 0) { Assert.state(this.beginWithNameAndTimeoutMethod != null, "WebLogic JTA API not initialized"); this.beginWithNameAndTimeoutMethod.invoke(getUserTransaction(), name, timeout); this.beginWithNameMethod.invoke(getUserTransaction(), name); throw new SystemException("Could not invoke WebLogic's UserTransaction.begin() method: " + ex); return new ManagedTransactionAdapter(obtainTransactionManager());
private TransactionManager obtainTransactionManager() { TransactionManager tm = getTransactionManager(); Assert.state(tm != null, "No TransactionManager set"); return tm; }
@Override @Nullable protected UserTransaction retrieveUserTransaction() throws TransactionSystemException { Object helper = loadWebLogicTransactionHelper(); try { logger.trace("Retrieving JTA UserTransaction from WebLogic TransactionHelper"); Method getUserTransactionMethod = helper.getClass().getMethod("getUserTransaction"); return (UserTransaction) getUserTransactionMethod.invoke(this.transactionHelper); } catch (InvocationTargetException ex) { throw new TransactionSystemException( "WebLogic's TransactionHelper.getUserTransaction() method failed", ex.getTargetException()); } catch (Exception ex) { throw new TransactionSystemException( "Could not invoke WebLogic's TransactionHelper.getUserTransaction() method", ex); } }
throws NotSupportedException, SystemException { int timeout = determineTimeout(definition); applyTimeout(txObject, timeout); txObject.getUserTransaction().begin(); if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) { try { Transaction tx = obtainTransactionManager().getTransaction(); Integer isolationLevel = definition.getIsolationLevel(); applyIsolationLevel(txObject, definition.getIsolationLevel());
private void loadWebLogicTransactionClasses() throws TransactionSystemException { try { Class<?> userTransactionClass = getClass().getClassLoader().loadClass(USER_TRANSACTION_CLASS_NAME); this.weblogicUserTransactionAvailable = userTransactionClass.isInstance(getUserTransaction()); if (this.weblogicUserTransactionAvailable) { this.beginWithNameMethod = userTransactionClass.getMethod("begin", String.class); logger.trace("WebLogic ClientTransactionManager found"); this.weblogicTransactionManagerAvailable = transactionManagerClass.isInstance(getTransactionManager()); if (this.weblogicTransactionManagerAvailable) { Class<?> transactionClass = getClass().getClassLoader().loadClass(TRANSACTION_CLASS_NAME);
obtainTransactionManager().resume((Transaction) suspendedTransaction); this.forceResumeMethod.invoke(getTransactionManager(), suspendedTransaction);
if (timeout >= 0) { Assert.state(this.beginWithNameAndTimeoutMethod != null, "WebLogic JTA API not initialized"); this.beginWithNameAndTimeoutMethod.invoke(getUserTransaction(), name, timeout); this.beginWithNameMethod.invoke(getUserTransaction(), name); throw new SystemException("Could not invoke WebLogic's UserTransaction.begin() method: " + ex); return new ManagedTransactionAdapter(obtainTransactionManager());
@Override public void afterPropertiesSet() throws TransactionSystemException { super.afterPropertiesSet(); loadWebLogicTransactionClasses(); }
private TransactionManager obtainTransactionManager() { TransactionManager tm = getTransactionManager(); Assert.state(tm != null, "No TransactionManager set"); return tm; }
@Override @Nullable protected TransactionManager retrieveTransactionManager() throws TransactionSystemException { Object helper = loadWebLogicTransactionHelper(); try { logger.trace("Retrieving JTA TransactionManager from WebLogic TransactionHelper"); Method getTransactionManagerMethod = helper.getClass().getMethod("getTransactionManager"); return (TransactionManager) getTransactionManagerMethod.invoke(this.transactionHelper); } catch (InvocationTargetException ex) { throw new TransactionSystemException( "WebLogic's TransactionHelper.getTransactionManager() method failed", ex.getTargetException()); } catch (Exception ex) { throw new TransactionSystemException( "Could not invoke WebLogic's TransactionHelper.getTransactionManager() method", ex); } }
throws NotSupportedException, SystemException { int timeout = determineTimeout(definition); applyTimeout(txObject, timeout); txObject.getUserTransaction().begin(); if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) { try { Transaction tx = obtainTransactionManager().getTransaction(); Integer isolationLevel = definition.getIsolationLevel(); applyIsolationLevel(txObject, definition.getIsolationLevel());