Package com.sun.jts.jta
Class TransactionImpl
- java.lang.Object
-
- com.sun.jts.jta.TransactionImpl
-
- All Implemented Interfaces:
TransactionInternal
,jakarta.transaction.Transaction
public class TransactionImpl extends Object implements TransactionInternal
An implementation of jakarta.transaction.Transaction using JTS XXX TODO should catch all org.omg.CORBA.SystemException and throw jakarta.transaction.SystemException- Author:
- Tony Ng
-
-
Constructor Summary
Constructors Constructor Description TransactionImpl(org.omg.CosTransactions.Control control, GlobalTID gtid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit()
Complete the transaction represented by this Transaction objectboolean
delistResource(XAResource res, int flags)
boolean
enlistResource(XAResource res)
enlist a resource with the current transaction If a transaction is marked as rollback, enlistment will succeed if the resource has been enlisted before.boolean
equals(Object object)
long
getStartTime()
int
getStatus()
String
getTransactionId()
int
hashCode()
void
registerInterposedSynchronization(jakarta.transaction.Synchronization sync)
Register a Synchronization instance with special ordering semantics.void
registerSynchronization(jakarta.transaction.Synchronization sync)
void
rollback()
Rollback the transaction represented by this Transaction object.void
setRollbackOnly()
-
-
-
Constructor Detail
-
TransactionImpl
public TransactionImpl(org.omg.CosTransactions.Control control, GlobalTID gtid) throws jakarta.transaction.SystemException
- Throws:
jakarta.transaction.SystemException
-
-
Method Detail
-
commit
public void commit() throws jakarta.transaction.HeuristicMixedException, jakarta.transaction.RollbackException, jakarta.transaction.HeuristicRollbackException, IllegalStateException, SecurityException, jakarta.transaction.SystemException
Complete the transaction represented by this Transaction object- Specified by:
commit
in interfacejakarta.transaction.Transaction
- Throws:
jakarta.transaction.HeuristicMixedException
jakarta.transaction.RollbackException
jakarta.transaction.HeuristicRollbackException
IllegalStateException
SecurityException
jakarta.transaction.SystemException
-
rollback
public void rollback() throws IllegalStateException, jakarta.transaction.SystemException
Rollback the transaction represented by this Transaction object.- Specified by:
rollback
in interfacejakarta.transaction.Transaction
- Throws:
IllegalStateException
jakarta.transaction.SystemException
-
enlistResource
public boolean enlistResource(XAResource res) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
enlist a resource with the current transaction If a transaction is marked as rollback, enlistment will succeed if the resource has been enlisted before. Otherwise, enlistment will fail. In both cases, a RollbackException will be thrown.- Specified by:
enlistResource
in interfacejakarta.transaction.Transaction
- Throws:
jakarta.transaction.RollbackException
IllegalStateException
jakarta.transaction.SystemException
-
delistResource
public boolean delistResource(XAResource res, int flags) throws IllegalStateException, jakarta.transaction.SystemException
- Specified by:
delistResource
in interfacejakarta.transaction.Transaction
- Throws:
IllegalStateException
jakarta.transaction.SystemException
-
getStatus
public int getStatus() throws jakarta.transaction.SystemException
- Specified by:
getStatus
in interfacejakarta.transaction.Transaction
- Throws:
jakarta.transaction.SystemException
-
registerSynchronization
public void registerSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
- Specified by:
registerSynchronization
in interfacejakarta.transaction.Transaction
- Throws:
jakarta.transaction.RollbackException
IllegalStateException
jakarta.transaction.SystemException
-
registerInterposedSynchronization
public void registerInterposedSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemException
Description copied from interface:TransactionInternal
Register a Synchronization instance with special ordering semantics.- Specified by:
registerInterposedSynchronization
in interfaceTransactionInternal
- Parameters:
sync
- - the Synchronization instance.- Throws:
jakarta.transaction.RollbackException
IllegalStateException
jakarta.transaction.SystemException
- See Also:
TransactionSynchronizationRegistry.registerInterposedSynchronization(Synchronization)
-
setRollbackOnly
public void setRollbackOnly() throws IllegalStateException, jakarta.transaction.SystemException
- Specified by:
setRollbackOnly
in interfacejakarta.transaction.Transaction
- Throws:
IllegalStateException
jakarta.transaction.SystemException
-
getTransactionId
public String getTransactionId()
-
getStartTime
public long getStartTime()
-
-