|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TransactionResource
A TransactionResource represents a participant in a transaction.
When a subsystem is used and it can participate in a transaction, it should
register itself with the current by calling the join method.
The resource manager should carefully lock its objects to provide the
appropriate guarantees.
At the end of a transaction, the transaction manager will call-back the
resource manager and ask for the outcome of this transaction with the
prepare(TransactionContext) method.
If the resource manager has not experienced any problems for this
transaction, it should silently return. If the transaction could not be
persisted, it should throw an appropriate exception.
After all the participating resource managers have been consulted, the
transaction manager will call commit(TransactionContext) to make the
changes persistent or rollback(TransactionContext) to undo all the
changes that were made since the transaction started.
| Method Summary | |
|---|---|
void |
commit(TransactionContext transaction)
Commit all the changes associated with the given transaction. |
void |
prepare(TransactionContext transaction)
Prepare for the changes to be made persistent, no further changes in this transaction will be made. |
void |
rollback(TransactionContext transaction)
Undo all the changes made to this subsystem that are associated with the given transaction. |
| Method Detail |
|---|
void prepare(TransactionContext transaction)
throws java.lang.Exception
transaction - The associated transaction.
java.lang.Exception - When there is an inconsistency or other error, the
exception will reflect this. An exception indicates that the
transaction will be rolled back. The
rollback(TransactionContext) method will still be
called.void rollback(TransactionContext transaction)
transaction - The associated transaction.void commit(TransactionContext transaction)
transaction -
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||