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

public Class TransactionImpl

extends Object
implements Transaction
Class Inheritance
All Implemented Interfaces
jakarta.transaction.Transaction
Annotations
@Deprecated
Imports
java.lang.reflect.Proxy, .InvocationHandler, java.util.Vector, java.sql.*, javax.transaction.xa.XAResource, jakarta.transaction.*, org.eclipse.persistence.exceptions.TransactionException, org.eclipse.persistence.internal.jpa.jdbc.ConnectionProxyHandler, .DataSourceImpl

Deprecated

Implementation of JTA Transaction class. The guts of the tx logic is contained in this class. Currently support is limited to enlisting only a single tx data source

Field Summary

Modifier and TypeField and Description
pack-priv Connection
pack-priv DataSourceImpl
public static boolean
pack-priv Vector<E>
pack-priv boolean
pack-priv static Class<?>
pack-priv int
public static final int
STATUS_ACTIVE

Static constants

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
commit()

Implements jakarta.transaction.Transaction.commit.

Complete the transaction represented by this Transaction object.
public void
private void
public boolean
delistResource(XAResource
The XAResource object associated with the resource (connection).
xaresource
,
int
One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.
i
)

Implements jakarta.transaction.Transaction.delistResource.

Disassociate the resource specified from the transaction associated with the target Transaction object.
public boolean
enlistResource(XAResource
The XAResource object associated with the resource (connection).
xaresource
)

Implements jakarta.transaction.Transaction.enlistResource.

Enlist the resource specified with the transaction associated with the target Transaction object.
public Connection
public int
getStatus()

Implements jakarta.transaction.Transaction.getStatus.

Obtain the status of the transaction associated with the target Transaction object.
public void
public void
registerSynchronization(Synchronization
The Synchronization object for the transaction associated with the target object.
synchronization
)

Implements jakarta.transaction.Transaction.registerSynchronization.

Register a synchronization object for the transaction currently associated with the target object.
public void
rollback()

Implements jakarta.transaction.Transaction.rollback.

Rollback the transaction represented by this Transaction object.
public void
public void
setRollbackOnly()

Implements jakarta.transaction.Transaction.setRollbackOnly.

Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionback to summary
pack-priv Connection connection
dataSourceback to summary
pack-priv DataSourceImpl dataSource
DUMP_AFTER_COMPLETION_ERRORSback to summary
public static boolean DUMP_AFTER_COMPLETION_ERRORS
listenersback to summary
pack-priv Vector<E> listeners
markedForRollbackback to summary
pack-priv boolean markedForRollback
proxyClassback to summary
pack-priv static Class<?> proxyClass
statusback to summary
pack-priv int status
STATUS_ACTIVEback to summary
public static final int STATUS_ACTIVE

Static constants

STATUS_COMMITTEDback to summary
public static final int STATUS_COMMITTED
STATUS_COMMITTINGback to summary
public static final int STATUS_COMMITTING
STATUS_MARKED_ROLLBACKback to summary
public static final int STATUS_MARKED_ROLLBACK
STATUS_NO_TRANSACTIONback to summary
public static final int STATUS_NO_TRANSACTION
STATUS_PREPAREDback to summary
public static final int STATUS_PREPARED
STATUS_PREPARINGback to summary
public static final int STATUS_PREPARING
STATUS_ROLLEDBACKback to summary
public static final int STATUS_ROLLEDBACK
STATUS_ROLLING_BACKback to summary
public static final int STATUS_ROLLING_BACK
STATUS_UNKNOWNback to summary
public static final int STATUS_UNKNOWN

Constructor Detail

TransactionImplback to summary
public TransactionImpl()

Method Detail

cleanupback to summary
public void cleanup()
commitback to summary
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException

Implements jakarta.transaction.Transaction.commit.

Doc from jakarta.transaction.Transaction.commit.

Complete the transaction represented by this Transaction object.

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 transaction in the target object is inactive.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
commitConnectionback to summary
public void commitConnection() throws SQLException
debugback to summary
private void debug(String s)
delistResourceback to summary
public boolean delistResource(XAResource xaresource, int i) throws IllegalStateException, SystemException

Implements jakarta.transaction.Transaction.delistResource.

Doc from jakarta.transaction.Transaction.delistResource.

Disassociate the resource specified from the transaction associated with the target Transaction object.

Parameters
xaresource:XAResource

The XAResource object associated with the resource (connection).

i:int

One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.

Returns:boolean

true if the resource was delisted successfully; otherwise false.

Annotations
@Override
Exceptions
IllegalStateException:
Thrown if the transaction in the target object is inactive.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
enlistResourceback to summary
public boolean enlistResource(XAResource xaresource) throws RollbackException, IllegalStateException, SystemException

Implements jakarta.transaction.Transaction.enlistResource.

Doc from jakarta.transaction.Transaction.enlistResource.

Enlist the resource specified with the transaction associated with the target Transaction object.

Parameters
xaresource:XAResource

The XAResource object associated with the resource (connection).

Returns:boolean

true if the resource was enlisted successfully; otherwise false.

Annotations
@Override
Exceptions
RollbackException:
Thrown to indicate that the transaction has been marked for rollback only.
IllegalStateException:
Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
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.Transaction.getStatus.

Doc from jakarta.transaction.Transaction.getStatus.

Obtain the status of the transaction associated with the target Transaction object.

Returns:int

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

Annotations
@Override
Exceptions
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
invokeAfterCompletionback to summary
public void invokeAfterCompletion()
registerSynchronizationback to summary
public void registerSynchronization(Synchronization synchronization) throws RollbackException, IllegalStateException, SystemException

Implements jakarta.transaction.Transaction.registerSynchronization.

Doc from jakarta.transaction.Transaction.registerSynchronization.

Register a synchronization object for the transaction currently associated with the target object. The transction manager invokes the beforeCompletion method prior to starting the two-phase transaction commit process. After the transaction is completed, the transaction manager invokes the afterCompletion method.

Parameters
synchronization:Synchronization

The Synchronization object for the transaction associated with the target object.

Annotations
@Override
Exceptions
RollbackException:
Thrown to indicate that the transaction has been marked for rollback only.
IllegalStateException:
Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
rollbackback to summary
public void rollback() throws IllegalStateException, SystemException

Implements jakarta.transaction.Transaction.rollback.

Doc from jakarta.transaction.Transaction.rollback.

Rollback the transaction represented by this Transaction object.

Annotations
@Override
Exceptions
IllegalStateException:
Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.
rollbackConnectionback to summary
public void rollbackConnection() throws SQLException
setRollbackOnlyback to summary
public void setRollbackOnly() throws IllegalStateException, SystemException

Implements jakarta.transaction.Transaction.setRollbackOnly.

Doc from jakarta.transaction.Transaction.setRollbackOnly.

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

Annotations
@Override
Exceptions
IllegalStateException:
Thrown if the target object is not associated with any transaction.
SystemException:
Thrown if the transaction manager encounters an unexpected error condition.