|
TrueUpdate Manager Specification 0.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.trueupdate.manager.spec.tx.Transaction
public abstract class Transaction
A simple interface for local transactions. The use case is to compose file system operations with ACID properties into larger transactions, for example for undeploying, updating and deploying an enterprise application to an application server.
Note that transactions are generally not idempotent, that is once their
execution has succeeded, you may not be able to execute them successfully
again because the preconditions for a successful execution are no longer met.
However, transactions must be retryable, that is if prepare() has
thrown an exception or perform() has thrown an exception and
rollback() has succeeded, then clients will still be able to
execute them successfully as soon as the preconditions for a successful
execution are met.
Transactions.execute(net.java.trueupdate.manager.spec.tx.Transaction),
CompositeTransaction| Constructor Summary | |
|---|---|
Transaction()
|
|
| Method Summary | |
|---|---|
void |
commit()
Commits the visible side effects of the body of this transaction. |
abstract void |
perform()
Executes the body of this transaction. |
void |
prepare()
Sets up this transaction for execution. |
abstract void |
rollback()
Reverts any visible side effects of the body of this transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Transaction()
| Method Detail |
|---|
public void commit()
perform()
must be durable.
If this method throws a RuntimeException, then the state of this
transaction is undefined and may be inconsistent.
If this method throws a RuntimeException and this transaction is
part of a composite transaction, then the preceding transactions get
neither committed nor rolled back and their state is undefined and may
be inconsistent.
public abstract void perform()
throws Exception
Exception, then this transaction gets
aborted with calling rollback(), so it may leave some
visible side effects.
If this method throws an Exception and this transaction is part
of a composite transaction, then the preceding transactions get
properly rolled back.
Exception
public void prepare()
throws Exception
Exception, then this transaction gets
aborted without calling rollback(), so it must not
leave any visible side effects.
If this method throws an Exception and this transaction is part
of a composite transaction, then the preceding transactions get
properly rolled back.
Exceptionpublic abstract void rollback()
perform().
If this method throws a RuntimeException, then the state of this
transaction is undefined and may be inconsistent.
If this method throws a RuntimeException and this transaction is
part of a composite transaction, then the preceding transactions get
neither committed nor rolled back and their state is undefined and may
be inconsistent.
|
TrueUpdate Manager Specification 0.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||