Class SpringJtaSynchronizationAdapter

java.lang.Object
org.springframework.transaction.jta.SpringJtaSynchronizationAdapter
All Implemented Interfaces:
Synchronization

public class SpringJtaSynchronizationAdapter extends Object implements Synchronization
Adapter that implements the JTA Synchronization interface delegating to an underlying Spring TransactionSynchronization.

Useful for synchronizing Spring resource management code with plain JTA / EJB CMT transactions, despite the original code being built for Spring transaction synchronization.

Since:
2.0
Author:
Juergen Hoeller
See Also:
  • Field Details

    • logger

      protected static final Log logger
  • Constructor Details

    • SpringJtaSynchronizationAdapter

      public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization)
      Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
      Parameters:
      springSynchronization - the Spring TransactionSynchronization to delegate to
    • SpringJtaSynchronizationAdapter

      @Deprecated(since="6.0.12") public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization, @Nullable UserTransaction jtaUserTransaction)
      Deprecated.
      as of 6.0.12 since JTA 1.1+ requires implicit rollback-only setting in case of an exception thrown in beforeCompletion, so the regular SpringJtaSynchronizationAdapter(TransactionSynchronization) constructor is sufficient for all scenarios
      Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
      Parameters:
      springSynchronization - the Spring TransactionSynchronization to delegate to
      jtaUserTransaction - the JTA UserTransaction to use for rollback-only setting in case of an exception thrown in beforeCompletion
    • SpringJtaSynchronizationAdapter

      @Deprecated(since="6.0.12") public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization, @Nullable TransactionManager jtaTransactionManager)
      Deprecated.
      as of 6.0.12 since JTA 1.1+ requires implicit rollback-only setting in case of an exception thrown in beforeCompletion, so the regular SpringJtaSynchronizationAdapter(TransactionSynchronization) constructor is sufficient for all scenarios
      Create a new SpringJtaSynchronizationAdapter for the given Spring TransactionSynchronization and JTA TransactionManager.
      Parameters:
      springSynchronization - the Spring TransactionSynchronization to delegate to
      jtaTransactionManager - the JTA TransactionManager to use for rollback-only setting in case of an exception thrown in beforeCompletion
  • Method Details