public class UserTransactionImpl extends Object implements UserTransaction, Referenceable, Serializable
Constructor and Description |
---|
UserTransactionImpl() |
Modifier and Type | Method and Description |
---|---|
void |
begin()
Create a new transaction and associate it with the current thread.
|
void |
commit()
Complete the transaction associated with the current thread.
|
Reference |
getReference()
This method is used by JNDI to store a referenceable object.
|
int |
getStatus()
Obtain the status of the transaction associated with the current thread.
|
void |
rollback()
Roll back the transaction associated with the current thread.
|
void |
setRollbackOnly()
Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction.
|
void |
setTransactionTimeout(int seconds)
Modify the timeout value that is associated with transactions started
by subsequent invocations of the begin method.
|
public void begin() throws NotSupportedException, SystemException
begin
in interface UserTransaction
IllegalStateException
- Thrown if the thread is already
associated with a transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionNotSupportedException
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
commit
in interface UserTransaction
TransactionRolledbackException
- 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 conditionRollbackException
public void rollback() throws IllegalStateException, SecurityException, SystemException
rollback
in interface UserTransaction
SecurityException
- Thrown to indicate that the thread is
not allowed to roll back the transaction.IllegalStateException
- Thrown if the current thread is
not associated with a transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface UserTransaction
IllegalStateException
- Thrown if the current thread is
not associated with a transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic int getStatus() throws SystemException
getStatus
in interface UserTransaction
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void setTransactionTimeout(int seconds) throws SystemException
If an application has not called this method, the transaction service uses some default value for the transaction timeout.
setTransactionTimeout
in interface UserTransaction
seconds
- 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.SystemException
- Thrown if the transaction manager
encounters an unexpected error condition.public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
Copyright © 2019. All rights reserved.