|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionCollaborator<K,V,P>
A transaction collaborator is used by a database that participates in a
transaction. It provides a way for the Transaction
to communicate
with the Database
.
The collaborator contains the state of the database that is associated with one specific transaction.
Database clients do not have to care about transaction collaborators.
Transaction
,
TransactionalDatabase
Method Summary | |
---|---|
void |
commit()
Commit this collaborator's work. |
DatabaseBackend<K,V,P> |
getBackend()
Get the database's DatabaseBackend object. |
String |
getReasonForUnableToCommit()
Can this collaborator commit its changes? If not, why? |
boolean |
isFinished()
Has this collaborator finished or rolled back its part of the transaction? |
boolean |
isReadOnly()
Does this collaborator's Database participate in the
transaction read only? |
void |
rollback()
Roll back this collaborator's work. |
Method Detail |
---|
String getReasonForUnableToCommit()
null
if the collaborator is able to commit its changes to
its database, or a reason for why it cannot.void commit() throws IllegalStateException
getReasonForUnableToCommit()
has been called on all
collaborators.
This method should really not throw any exceptions since that would put
the resources participating in the entire transaction in an undefined
state. If the collaborator cannot commit the work in the database, it
should say so when asked via the getReasonForUnableToCommit()
.
IllegalStateException
- If this collaborator's work has already
been committed or rolled back.void rollback()
This method should try to avoid throwing exceptions since that may put the resources participating in the entire transaction in an undefined state.
boolean isReadOnly()
Database
participate in the
transaction read only?
true
if this collaborator's Database
participates in the transaction read only.boolean isFinished()
true
if this collaborator has finished or rolled back its
part of the transaction.DatabaseBackend<K,V,P> getBackend()
DatabaseBackend
object.
DatabaseBackend
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |