Top Description Methods
org.springframework.transaction.jta

public Interface TransactionFactory

Known Direct Implementers
org.springframework.transaction.jta.JtaTransactionManager, org.springframework.transaction.jta.SimpleTransactionFactory
Imports
jakarta.transaction.NotSupportedException, .SystemException, .Transaction, org.springframework.lang.Nullable

Strategy interface for creating JTA jakarta.transaction.Transaction objects based on specified transactional characteristics.

The default implementation, SimpleTransactionFactory, simply wraps a standard JTA jakarta.transaction.TransactionManager. This strategy interface allows for more sophisticated implementations that adapt to vendor-specific JTA extensions.

Author
Juergen Hoeller
Since
2.5
See Also
jakarta.transaction.TransactionManager#getTransaction(), SimpleTransactionFactory, JtaTransactionManager

Method Summary

Modifier and TypeMethod and Description
public Transaction

Returns:

the active Transaction object (never null)
createTransaction
(String
the transaction name (may be null)
name
,
int
the transaction timeout (may be -1 for the default timeout)
timeout
)

Create an active Transaction object based on the given name and timeout.

public boolean
supportsResourceAdapterManagedTransactions()

Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).

Method Detail

createTransactionback to summary
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException

Create an active Transaction object based on the given name and timeout.

Parameters
name:String

the transaction name (may be null)

timeout:int

the transaction timeout (may be -1 for the default timeout)

Returns:Transaction

the active Transaction object (never null)

Exceptions
NotSupportedException:
if the transaction manager does not support a transaction of the specified type
SystemException:
if the transaction manager failed to create the transaction
supportsResourceAdapterManagedTransactionsback to summary
public boolean supportsResourceAdapterManagedTransactions()

Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).

Typically false. Checked by org.springframework.jca.endpoint.AbstractMessageEndpointFactory in order to differentiate between invalid configuration and valid ResourceAdapter-managed transactions.

See Also
jakarta.resource.spi.ResourceAdapter#endpointActivation, jakarta.resource.spi.endpoint.MessageEndpointFactory#isDeliveryTransacted