this.transactionManager = lookupTransactionManager(this.transactionManagerName);
this.transactionManager = lookupTransactionManager(this.transactionManagerName);
/** * Find the JTA TransactionManager through autodetection: * checking whether the UserTransaction object implements the * TransactionManager, and checking the fallback JNDI locations. * @param ut the JTA UserTransaction object * @return the JTA TransactionManager reference, or <code>null</code> if not found * @see #FALLBACK_TRANSACTION_MANAGER_NAMES */ protected TransactionManager findTransactionManager(UserTransaction ut) { if (ut instanceof TransactionManager) { if (logger.isDebugEnabled()) { logger.debug("JTA UserTransaction object [" + ut + "] implements TransactionManager"); } return (TransactionManager) ut; } // Check fallback JNDI locations. for (int i = 0; i < FALLBACK_TRANSACTION_MANAGER_NAMES.length; i++) { String jndiName = FALLBACK_TRANSACTION_MANAGER_NAMES[i]; try { TransactionManager tm = lookupTransactionManager(jndiName); logger.debug("JTA TransactionManager found at fallback JNDI location [" + jndiName + "]"); return tm; } catch (TransactionSystemException ex) { logger.debug("No JTA TransactionManager found at fallback JNDI location [" + jndiName + "]", ex); } } // OK, so no JTA TransactionManager is available... return null; }
private void readObject(ObjectInputStream ois) throws IOException { // Rely on default serialization, just initialize state after deserialization. try { ois.defaultReadObject(); } catch (ClassNotFoundException ex) { throw new IOException( "Failed to deserialize JtaTransactionManager - check that JTA and Spring transaction " + "libraries are available on the client side: " + ex.getMessage()); } // Do client-side JNDI lookup. this.jndiTemplate = new JndiTemplate(); // Perform lookup for JTA UserTransaction and TransactionManager. if (this.userTransactionName != null) { this.userTransaction = lookupUserTransaction(this.userTransactionName); } if (this.transactionManagerName != null) { this.transactionManager = lookupTransactionManager(this.transactionManagerName); } }
this.transactionManager = lookupTransactionManager(this.transactionManagerName);
this.transactionManager = lookupTransactionManager(this.transactionManagerName);
this.transactionManager = lookupTransactionManager(this.transactionManagerName);