Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.transaction

public Class TransactionManagerImpl

extends Object
implements TransactionManager, UserTransaction
Class Inheritance
All Implemented Interfaces
jakarta.transaction.UserTransaction, jakarta.transaction.TransactionManager
Annotations
@Deprecated
Imports
java.sql.Connection, .SQLException, jakarta.transaction.*, org.eclipse.persistence.internal.jpa.jdbc.DataSourceImpl

Deprecated

Implementation of JTA Transaction manager class. Currently support is limited to enlisting a single tx data source

Field Summary

Modifier and TypeField and Description
pack-priv TransactionImpl
tx

Deprecated as a consequence of TransactionImpl being deprecated.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
begin()

Implements jakarta.transaction.TransactionManager.begin, jakarta.transaction.UserTransaction.begin.

Create a new transaction and associate it with the current thread.
public void
commit()

Implements jakarta.transaction.TransactionManager.commit, jakarta.transaction.UserTransaction.commit.

Complete the transaction associated with the current thread.
private void
public Connection
public int
getStatus()

Implements jakarta.transaction.TransactionManager.getStatus, jakarta.transaction.UserTransaction.getStatus.

Obtain the status of the transaction associated with the current thread.
public Transaction
getTransaction()

Implements jakarta.transaction.TransactionManager.getTransaction.

Get the transaction object that represents the transaction context of the calling thread.
public boolean
public void
resume(Transaction
The Transaction object that represents the transaction to be resumed.
transaction
)

Implements jakarta.transaction.TransactionManager.resume.

Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object.
public void
rollback()

Implements jakarta.transaction.TransactionManager.rollback, jakarta.transaction.UserTransaction.rollback.

Roll back the transaction associated with the current thread.
public void
setRollbackOnly()

Implements jakarta.transaction.TransactionManager.setRollbackOnly, jakarta.transaction.UserTransaction.setRollbackOnly.

Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
public void
setTransactionTimeout(int
The value of the timeout in seconds. If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.
i
)

Implements jakarta.transaction.TransactionManager.setTransactionTimeout, jakarta.transaction.UserTransaction.setTransactionTimeout.

Modify the timeout value that is associated with transactions started by the current thread with the begin method.
public Transaction
suspend()

Implements jakarta.transaction.TransactionManager.suspend.

Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

txback to summary
pack-priv TransactionImpl tx

Deprecated

as a consequence of TransactionImpl being deprecated. See corresponding docs for further information.

Constructor Detail

TransactionManagerImplback to summary
public TransactionManagerImpl()

Method Detail

beginback to summary
public void begin() throws NotSupportedException, SystemException

Implements jakarta.transaction.TransactionManager.begin, jakarta.transaction.UserTransaction.begin.

Doc from jakarta.transaction.TransactionManager.begin.

Create a new transaction and associate it with the current thread.

Annotations
@Override
Exceptions
NotSupportedException:
Thrown if the thread is already associated with a transaction and the Transaction Manager implementation does not support nested transactions.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
commitback to summary
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException

Implements jakarta.transaction.TransactionManager.commit, jakarta.transaction.UserTransaction.commit.

Doc from jakarta.transaction.TransactionManager.commit.

Complete the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Annotations
@Override
Exceptions
RollbackException:
Thrown to indicate that the transaction has been rolled back rather than committed.
HeuristicMixedException:
Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
HeuristicRollbackException:
Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.
SecurityException:
Thrown to indicate that the thread is not allowed to commit the transaction.
IllegalStateException:
Thrown if the current thread is not associated with a transaction.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
debugback to summary
private void debug(String s)
getConnectionback to summary
public Connection getConnection(DataSourceImpl ds, String user, String password) throws SQLException
getStatusback to summary
public int getStatus() throws SystemException

Implements jakarta.transaction.TransactionManager.getStatus, jakarta.transaction.UserTransaction.getStatus.

Doc from jakarta.transaction.TransactionManager.getStatus.

Obtain the status of the transaction associated with the current thread.

Returns:int

The transaction status. If no transaction is associated with the current thread, this method returns the Status.NoTransaction value.

Annotations
@Override
Exceptions
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
getTransactionback to summary
public Transaction getTransaction() throws SystemException

Implements jakarta.transaction.TransactionManager.getTransaction.

Doc from jakarta.transaction.TransactionManager.getTransaction.

Get the transaction object that represents the transaction context of the calling thread.

Returns:Transaction

the Transaction object representing the transaction associated with the calling thread.

Annotations
@Override
Exceptions
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
isTransactionActiveback to summary
public boolean isTransactionActive()
resumeback to summary
public void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException

Implements jakarta.transaction.TransactionManager.resume.

Doc from jakarta.transaction.TransactionManager.resume.

Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object. When this method returns, the calling thread is associated with the transaction context specified.

Parameters
transaction:Transaction

The Transaction object that represents the transaction to be resumed.

Annotations
@Override
Exceptions
InvalidTransactionException:
Thrown if the parameter transaction object contains an invalid transaction.
IllegalStateException:
Thrown if the thread is already associated with another transaction.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
rollbackback to summary
public void rollback() throws IllegalStateException, SecurityException, SystemException

Implements jakarta.transaction.TransactionManager.rollback, jakarta.transaction.UserTransaction.rollback.

Doc from jakarta.transaction.TransactionManager.rollback.

Roll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Annotations
@Override
Exceptions
IllegalStateException:
Thrown if the current thread is not associated with a transaction.
SecurityException:
Thrown to indicate that the thread is not allowed to roll back the transaction.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
setRollbackOnlyback to summary
public void setRollbackOnly() throws IllegalStateException, SystemException

Implements jakarta.transaction.TransactionManager.setRollbackOnly, jakarta.transaction.UserTransaction.setRollbackOnly.

Doc from jakarta.transaction.TransactionManager.setRollbackOnly.

Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.

Annotations
@Override
Exceptions
IllegalStateException:
Thrown if the current thread is not associated with a transaction.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
setTransactionTimeoutback to summary
public void setTransactionTimeout(int i) throws SystemException

Implements jakarta.transaction.TransactionManager.setTransactionTimeout, jakarta.transaction.UserTransaction.setTransactionTimeout.

Doc from jakarta.transaction.TransactionManager.setTransactionTimeout.

Modify the timeout value that is associated with transactions started by the current thread with the begin method.

If an application has not called this method, the transaction service uses some default value for the transaction timeout.

Parameters
i:int

The value of the timeout in seconds. If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.

Annotations
@Override
Exceptions
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
suspendback to summary
public Transaction suspend() throws SystemException

Implements jakarta.transaction.TransactionManager.suspend.

Doc from jakarta.transaction.TransactionManager.suspend.

Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended. If the calling thread is not associated with a transaction, the method returns a null object reference. When this method returns, the calling thread is not associated with a transaction.

Returns:Transaction

Transaction object representing the suspended transaction.

Annotations
@Override
Exceptions
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.