/** * Build a UserTransaction handle based on the given TransactionManager. * @param transactionManager the TransactionManager * @return a corresponding UserTransaction handle */ protected UserTransaction buildUserTransaction(TransactionManager transactionManager) { if (transactionManager instanceof UserTransaction) { return (UserTransaction) transactionManager; } else { return new UserTransactionAdapter(transactionManager); } }
/** * Build a UserTransaction handle based on the given TransactionManager. * @param transactionManager the TransactionManager * @return a corresponding UserTransaction handle */ protected UserTransaction buildUserTransaction(TransactionManager transactionManager) { if (transactionManager instanceof UserTransaction) { return (UserTransaction) transactionManager; } else { return new UserTransactionAdapter(transactionManager); } }
/** * Create a new ConfigurableJtaPlatform instance with the given * JTA TransactionManager and optionally a given UserTransaction. * @param tm the JTA TransactionManager reference (required) * @param ut the JTA UserTransaction reference (optional) * @param tsr the JTA 1.1 TransactionSynchronizationRegistry (optional) */ public ConfigurableJtaPlatform(TransactionManager tm, @Nullable UserTransaction ut, @Nullable TransactionSynchronizationRegistry tsr) { Assert.notNull(tm, "TransactionManager reference must not be null"); this.transactionManager = tm; this.userTransaction = (ut != null ? ut : new UserTransactionAdapter(tm)); this.transactionSynchronizationRegistry = tsr; }
/** * Create a new SpringJtaSynchronizationAdapter for the given Spring * TransactionSynchronization and JTA TransactionManager. * <p>Note that this adapter will never perform a rollback-only call on WebLogic, * since WebLogic Server is known to automatically mark the transaction as * rollback-only in case of a {@code beforeCompletion} exception. Hence, * on WLS, this constructor is equivalent to the single-arg constructor. * @param springSynchronization the Spring TransactionSynchronization to delegate to * @param jtaTransactionManager the JTA TransactionManager to use for rollback-only * setting in case of an exception thrown in {@code beforeCompletion} * (can be omitted if the JTA provider itself marks the transaction rollback-only * in such a scenario, which is required by the JTA specification as of JTA 1.1) */ public SpringJtaSynchronizationAdapter( TransactionSynchronization springSynchronization, @Nullable TransactionManager jtaTransactionManager) { this(springSynchronization); if (jtaTransactionManager != null && !jtaTransactionManager.getClass().getName().startsWith("weblogic.")) { this.jtaTransaction = new UserTransactionAdapter(jtaTransactionManager); } }
/** * Create a new ConfigurableJtaPlatform instance with the given * JTA TransactionManager and optionally a given UserTransaction. * @param tm the JTA TransactionManager reference (required) * @param ut the JTA UserTransaction reference (optional) * @param tsr the JTA 1.1 TransactionSynchronizationRegistry (optional) */ public ConfigurableJtaPlatform(TransactionManager tm, @Nullable UserTransaction ut, @Nullable TransactionSynchronizationRegistry tsr) { Assert.notNull(tm, "TransactionManager reference must not be null"); this.transactionManager = tm; this.userTransaction = (ut != null ? ut : new UserTransactionAdapter(tm)); this.transactionSynchronizationRegistry = tsr; }
/** * Create a new SpringJtaSynchronizationAdapter for the given Spring * TransactionSynchronization and JTA TransactionManager. * <p>Note that this adapter will never perform a rollback-only call on WebLogic, * since WebLogic Server is known to automatically mark the transaction as * rollback-only in case of a {@code beforeCompletion} exception. Hence, * on WLS, this constructor is equivalent to the single-arg constructor. * @param springSynchronization the Spring TransactionSynchronization to delegate to * @param jtaTransactionManager the JTA TransactionManager to use for rollback-only * setting in case of an exception thrown in {@code beforeCompletion} * (can be omitted if the JTA provider itself marks the transaction rollback-only * in such a scenario, which is required by the JTA specification as of JTA 1.1) */ public SpringJtaSynchronizationAdapter( TransactionSynchronization springSynchronization, @Nullable TransactionManager jtaTransactionManager) { this(springSynchronization); if (jtaTransactionManager != null && !jtaTransactionManager.getClass().getName().startsWith("weblogic.")) { this.jtaTransaction = new UserTransactionAdapter(jtaTransactionManager); } }
/** * Build a UserTransaction handle based on the given TransactionManager. * @param transactionManager the TransactionManager * @return a corresponding UserTransaction handle */ protected UserTransaction buildUserTransaction(TransactionManager transactionManager) { if (transactionManager instanceof UserTransaction) { return (UserTransaction) transactionManager; } else { return new UserTransactionAdapter(transactionManager); } }
/** * Build a UserTransaction handle based on the given TransactionManager. * @param transactionManager the TransactionManager * @return a corresponding UserTransaction handle */ protected UserTransaction buildUserTransaction(TransactionManager transactionManager) { if (transactionManager instanceof UserTransaction) { return (UserTransaction) transactionManager; } else { return new UserTransactionAdapter(transactionManager); } }
/** * Create a new ConfigurableJtaPlatform instance with the given * JTA TransactionManager and optionally a given UserTransaction. * @param tm the JTA TransactionManager reference (required) * @param ut the JTA UserTransaction reference (optional) * @param tsr the JTA 1.1 TransactionSynchronizationRegistry (optional) */ public ConfigurableJtaPlatform(TransactionManager tm, UserTransaction ut, TransactionSynchronizationRegistry tsr) { Assert.notNull(tm, "TransactionManager reference must not be null"); this.transactionManager = tm; this.userTransaction = (ut != null ? ut : new UserTransactionAdapter(tm)); this.transactionSynchronizationRegistry = tsr; }
/** * Create a new ConfigurableJtaPlatform instance with the given * JTA TransactionManager and optionally a given UserTransaction. * @param tm the JTA TransactionManager reference (required) * @param ut the JTA UserTransaction reference (optional) */ public ConfigurableJtaPlatform(TransactionManager tm, UserTransaction ut) { Assert.notNull(tm, "TransactionManager reference must not be null"); this.transactionManager = tm; this.userTransaction = (ut != null ? ut : new UserTransactionAdapter(tm)); }
/** * Create a new ConfigurableJtaPlatform instance with the given * JTA TransactionManager and optionally a given UserTransaction. * @param tm the JTA TransactionManager reference (required) * @param ut the JTA UserTransaction reference (optional) * @param tsr the JTA 1.1 TransactionSynchronizationRegistry (optional) */ public ConfigurableJtaPlatform(TransactionManager tm, @Nullable UserTransaction ut, @Nullable TransactionSynchronizationRegistry tsr) { Assert.notNull(tm, "TransactionManager reference must not be null"); this.transactionManager = tm; this.userTransaction = (ut != null ? ut : new UserTransactionAdapter(tm)); this.transactionSynchronizationRegistry = tsr; }
/** * Create a new SpringJtaSynchronizationAdapter for the given Spring * TransactionSynchronization and JTA TransactionManager. * <p>Note that this adapter will never perform a rollback-only call on WebLogic, * since WebLogic Server is known to automatically mark the transaction as * rollback-only in case of a {@code beforeCompletion} exception. Hence, * on WLS, this constructor is equivalent to the single-arg constructor. * @param springSynchronization the Spring TransactionSynchronization to delegate to * @param jtaTransactionManager the JTA TransactionManager to use for rollback-only * setting in case of an exception thrown in {@code beforeCompletion} * (can be omitted if the JTA provider itself marks the transaction rollback-only * in such a scenario, which is required by the JTA specification as of JTA 1.1) */ public SpringJtaSynchronizationAdapter( TransactionSynchronization springSynchronization, @Nullable TransactionManager jtaTransactionManager) { this(springSynchronization); if (jtaTransactionManager != null && !jtaTransactionManager.getClass().getName().startsWith("weblogic.")) { this.jtaTransaction = new UserTransactionAdapter(jtaTransactionManager); } }
/** * Create a new SpringJtaSynchronizationAdapter for the given Spring * TransactionSynchronization and JTA TransactionManager. * <p>Note that this adapter will never perform a rollback-only call on WebLogic, * since WebLogic Server is known to automatically mark the transaction as * rollback-only in case of a {@code beforeCompletion} exception. Hence, * on WLS, this constructor is equivalent to the single-arg constructor. * @param springSynchronization the Spring TransactionSynchronization to delegate to * @param jtaTransactionManager the JTA TransactionManager to use for rollback-only * setting in case of an exception thrown in {@code beforeCompletion} * (can be omitted if the JTA provider itself marks the transaction rollback-only * in such a scenario, which is required by the JTA specification as of JTA 1.1) */ public SpringJtaSynchronizationAdapter( TransactionSynchronization springSynchronization, @Nullable TransactionManager jtaTransactionManager) { this(springSynchronization); if (jtaTransactionManager != null && !jtaTransactionManager.getClass().getName().startsWith("weblogic.")) { this.jtaTransaction = new UserTransactionAdapter(jtaTransactionManager); } }
this.userTransaction = new UserTransactionAdapter(this.transactionManager);