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 voidcommit()Complete the transaction represented by this Transaction objectbooleandelistResource(XAResource res, int flags)booleanenlistResource(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.booleanequals(Object object)longgetStartTime()intgetStatus()StringgetTransactionId()inthashCode()voidregisterInterposedSynchronization(jakarta.transaction.Synchronization sync)Register a Synchronization instance with special ordering semantics.voidregisterSynchronization(jakarta.transaction.Synchronization sync)voidrollback()Rollback the transaction represented by this Transaction object.voidsetRollbackOnly()
-
-
-
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.SystemExceptionComplete the transaction represented by this Transaction object- Specified by:
commitin interfacejakarta.transaction.Transaction- Throws:
jakarta.transaction.HeuristicMixedExceptionjakarta.transaction.RollbackExceptionjakarta.transaction.HeuristicRollbackExceptionIllegalStateExceptionSecurityExceptionjakarta.transaction.SystemException
-
rollback
public void rollback() throws IllegalStateException, jakarta.transaction.SystemExceptionRollback the transaction represented by this Transaction object.- Specified by:
rollbackin interfacejakarta.transaction.Transaction- Throws:
IllegalStateExceptionjakarta.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:
enlistResourcein interfacejakarta.transaction.Transaction- Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
delistResource
public boolean delistResource(XAResource res, int flags) throws IllegalStateException, jakarta.transaction.SystemException
- Specified by:
delistResourcein interfacejakarta.transaction.Transaction- Throws:
IllegalStateExceptionjakarta.transaction.SystemException
-
getStatus
public int getStatus() throws jakarta.transaction.SystemException- Specified by:
getStatusin 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:
registerSynchronizationin interfacejakarta.transaction.Transaction- Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException
-
registerInterposedSynchronization
public void registerInterposedSynchronization(jakarta.transaction.Synchronization sync) throws jakarta.transaction.RollbackException, IllegalStateException, jakarta.transaction.SystemExceptionDescription copied from interface:TransactionInternalRegister a Synchronization instance with special ordering semantics.- Specified by:
registerInterposedSynchronizationin interfaceTransactionInternal- Parameters:
sync- - the Synchronization instance.- Throws:
jakarta.transaction.RollbackExceptionIllegalStateExceptionjakarta.transaction.SystemException- See Also:
TransactionSynchronizationRegistry.registerInterposedSynchronization(Synchronization)
-
setRollbackOnly
public void setRollbackOnly() throws IllegalStateException, jakarta.transaction.SystemException- Specified by:
setRollbackOnlyin interfacejakarta.transaction.Transaction- Throws:
IllegalStateExceptionjakarta.transaction.SystemException
-
getTransactionId
public String getTransactionId()
-
getStartTime
public long getStartTime()
-
-