|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataSourceTransaction
The Transaction
interface is used by DRAGOS to obtain
access to the transaction of the underlying data source.
Method Summary | |
---|---|
void |
begin()
Begins a new transaction on the data source. |
void |
commit()
Commits the current transaction on the data source. |
java.lang.String |
getName()
Returns the implementation-dependant name of the transaction (mostly useful for debugging). |
DataSourceTransaction |
getParentTransaction()
Returns the parent transaction if this is a nested transaction, null otherwise. |
Transaction.State |
getState()
Returns the current state of the transaction. |
void |
prepareCommit()
Prepares a transaction for two-phase commit. |
void |
rollback()
Performs a rollback on the current transaction and all nested transactions below it. |
void |
setRollbackOnly()
Sets rollback to be the only possible outcome of the transaction. |
Method Detail |
---|
void begin() throws DataSourceTransactionException
DataSourceTransactionException
- if it was not possible to create a new
transaction.void prepareCommit() throws DataSourceTransactionException
After this method, the transaction will be in state
Transaction.State#PREPARED
.
The TransactionManager will ensure that this method is called
before commit()
, and that the next method call will
either be to commit()
or rollback()
. No
graph data manipulation will happen between the call to this method
and the following call, and it is explicitly allowed for an
implementation to terminate the current session during execution
of this method, meaning any changes might not be visible
even in the context of this transaction until
the actual commit is performed.
If an implementation does not support the two-phase commit protocol,
it should just set its state to Transaction.State#PREPARED
and return.
DataSourceTransactionException
- if it was not possible to prepare the
transaction for two-phase commit.void commit() throws DataSourceTransactionException
DataSourceTransactionException
- if it was not possible to commit the
transaction.void rollback() throws DataSourceTransactionException
DataSourceTransactionException
- if it was not possible to rollback the transaction.Transaction.commit()
void setRollbackOnly() throws DataSourceTransactionException
DataSourceTransactionException
- if it was not possible to set the
transaction to rollback only.Transaction.State getState() throws DataSourceTransactionException
Status
object representing the status of the
transaction.
DataSourceTransactionException
- if it was not possible to get the
status information.java.lang.String getName() throws DataSourceTransactionException
DataSourceTransactionException
- if it was not possible to get the
string representation.DataSourceTransaction getParentTransaction() throws DataSourceTransactionException
null
otherwise.
null
otherwise.
DataSourceTransactionException
- in case of internal errors.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |