All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface javax.jts.UserTransaction

public interface interface UserTransaction
The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.


Variable Index

 o STATUS_ACTIVE
A transaction is associated with the target object and it is in the active state.
 o STATUS_COMMITTED
A transaction is associated with the target object and it has been committed.
 o STATUS_COMMITTING
A transaction is associated with the target object and it is in the process of committing.
 o STATUS_MARKED_ROLLBACK
A transaction is associated with the target object and it has been marked for rollback, perhaps as a result of a setRollbackOnly operation.
 o STATUS_NO_TRANSACTION
No transaction is currently associated with the target object.
 o STATUS_PREPARED
A transaction is associated with the target object and it has been prepared, i.e.
 o STATUS_PREPARING
A transaction is associated with the target object and it is in the process of preparing.
 o STATUS_ROLLEDBACK
A transaction is associated with the target object and the outcome has been determined as rollback.
 o STATUS_ROLLING_BACK
A transaction is associated with the target object and it is in the process of rolling back.
 o STATUS_UNKNOWN
A transaction is associated with the target object but its current status cannot be determined.

Method Index

 o begin()
Create a new transaction and associate it with the current thread.
 o commit()
Complete the transaction associated with the current thread.
 o getStatus()
Obtain the status of the transaction associated with the current thread.
 o rollback()
Roll back the transaction associated with the current thread.
 o setRollbackOnly()
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
 o setTransactionTimeout(int)
Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method.

Variables

 o STATUS_ACTIVE
 public static final int STATUS_ACTIVE
A transaction is associated with the target object and it is in the active state. An implementation returns this status after a transaction has been started and prior to a Coordinator issuing any prepares unless the transaction has been marked for rollback.

 o STATUS_MARKED_ROLLBACK
 public static final int STATUS_MARKED_ROLLBACK
A transaction is associated with the target object and it has been marked for rollback, perhaps as a result of a setRollbackOnly operation.

 o STATUS_PREPARED
 public static final int STATUS_PREPARED
A transaction is associated with the target object and it has been prepared, i.e. all subordinates have responded Vote.Commit. The target object may be waiting for a superior's instruction as how to proceed.

 o STATUS_COMMITTED
 public static final int STATUS_COMMITTED
A transaction is associated with the target object and it has been committed. It is likely that heuristics exists, otherwise the transaction would have been destroyed and NoTransaction returned.

 o STATUS_ROLLEDBACK
 public static final int STATUS_ROLLEDBACK
A transaction is associated with the target object and the outcome has been determined as rollback. It is likely that heuristics exist, otherwise the transaction would have been destroyed and NoTransaction returned.

 o STATUS_UNKNOWN
 public static final int STATUS_UNKNOWN
A transaction is associated with the target object but its current status cannot be determined. This is a transient condition and a subsequent invocation will ultimately return a different status.

 o STATUS_NO_TRANSACTION
 public static final int STATUS_NO_TRANSACTION
No transaction is currently associated with the target object. This will occur after a transaction has completed.

 o STATUS_PREPARING
 public static final int STATUS_PREPARING
A transaction is associated with the target object and it is in the process of preparing. An implementation returns this status if it has started preparing, but has not yet completed the process, probably because it is waiting for responses to prepare from one or more Resources.

 o STATUS_COMMITTING
 public static final int STATUS_COMMITTING
A transaction is associated with the target object and it is in the process of committing. An implementation returns this status if it has decided to commit, but has not yet completed the process, probably because it is waiting for responses from one or more Resources.

 o STATUS_ROLLING_BACK
 public static final int STATUS_ROLLING_BACK
A transaction is associated with the target object and it is in the process of rolling back. An implementation returns this status if it has decided to rollback, but has not yet completed the process, probably because it is waiting for responses from one or more Resources.

Methods

 o begin
 public abstract void begin() throws IllegalStateException
Create a new transaction and associate it with the current thread.

Throws: IllegalStateException
Thrown if the thread is already associated with a transaction.
 o commit
 public abstract void commit() throws TransactionRolledbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException
Complete the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction.

Throws: TransactionRolledbackException
Thrown to indicate that the transaction has been rolled back rather than committed.
Throws: HeuristicMixedException
Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
Throws: HeuristicRollbackException
Thrown to indicate that a heuristic decision was made and that some relevant updates have been rolled back.
Throws: SecurityException
Thrown to indicate that the thread is not allowed to commit the transaction.
Throws: IllegalStateException
Thrown if the current thread is not associated with a transaction.
 o rollback
 public abstract void rollback() throws IllegalStateException, SecurityException
Roll back the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction.

Throws: SecurityException
Thrown to indicate that the thread is not allowed to roll back the transaction.
Throws: IllegalStateException
Thrown if the current thread is not associated with a transaction.
 o setRollbackOnly
 public abstract void setRollbackOnly() throws IllegalStateException
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.

Throws: IllegalStateException
Thrown if the current thread is not associated with a transaction.
 o getStatus
 public abstract int getStatus()
Obtain the status of the transaction associated with the current thread.

Returns:
The transaction status. If no transaction is associated with the current thread, this method returns the Status.NoTransaction value.
 o setTransactionTimeout
 public abstract void setTransactionTimeout(int seconds)
Modify the value of the timeout value that is associated with the 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:
seconds - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value.

All Packages  Class Hierarchy  This Package  Previous  Next  Index