Top Description Fields Constructors Methods
org.springframework.transaction.jta

public Class SimpleTransactionFactory

extends Object
implements TransactionFactory
Class Inheritance
All Implemented Interfaces
org.springframework.transaction.jta.TransactionFactory
Imports
jakarta.transaction.NotSupportedException, .SystemException, .Transaction, .TransactionManager, org.springframework.lang.Nullable, org.springframework.util.Assert

Default implementation of the TransactionFactory strategy interface, simply wrapping a standard JTA jakarta.transaction.TransactionManager.

Does not support transaction names; simply ignores any specified name.

Author
Juergen Hoeller
Since
2.5
See Also
jakarta.transaction.TransactionManager#setTransactionTimeout(int), jakarta.transaction.TransactionManager#begin(), jakarta.transaction.TransactionManager#getTransaction()

Field Summary

Modifier and TypeField and Description
private final TransactionManager

Constructor Summary

AccessConstructor and Description
public
SimpleTransactionFactory(TransactionManager
the JTA TransactionManager to wrap
transactionManager
)

Create a new SimpleTransactionFactory for the given TransactionManager.

Method Summary

Modifier and TypeMethod and Description
public Transaction
createTransaction(String
the transaction name (may be null)
name
,
int
the transaction timeout (may be -1 for the default timeout)
timeout
)

Implements org.springframework.transaction.jta.TransactionFactory.createTransaction.

Create an active Transaction object based on the given name and timeout.
public boolean
supportsResourceAdapterManagedTransactions()

Implements org.springframework.transaction.jta.TransactionFactory.supportsResourceAdapterManagedTransactions.

Determine whether the underlying transaction manager supports XA transactions managed by a resource adapter (i.e. without explicit XA resource enlistment).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transactionManagerback to summary
private final TransactionManager transactionManager

Constructor Detail

SimpleTransactionFactoryback to summary
public SimpleTransactionFactory(TransactionManager transactionManager)

Create a new SimpleTransactionFactory for the given TransactionManager.

Parameters
transactionManager:TransactionManager

the JTA TransactionManager to wrap

Method Detail

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

Implements org.springframework.transaction.jta.TransactionFactory.createTransaction.

Doc from org.springframework.transaction.jta.TransactionFactory.createTransaction.

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)

Annotations
@Override
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()

Implements org.springframework.transaction.jta.TransactionFactory.supportsResourceAdapterManagedTransactions.

Doc from org.springframework.transaction.jta.TransactionFactory.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.

Annotations
@Override