|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionManager
The TransactionManager creates and manages transactions.
Please refer to the "Guide to Transactions" in the documentation for more information.
Because TransactionManagers are instantiated through reflection, there is an additional requirement beyond
implementing the methods in this interface: Every TransactionManager must provide a public constructor that takes a
DataSourceURL[]
array as its only argument. This will be used to pass the DataSourceURL(s) of the
graph pool(s) to manage. If the implementation can not handle the type of data source, or is not capable of
distributed transactions, it must throw a TransactionManagerException
.
Method Summary | |
---|---|
Transaction |
createTransaction()
Creates a Transaction object for the specific implementation. |
Transaction |
getCurrentTransaction()
Gets the currently active Transaction , if any. |
java.util.Collection<DataSourceURL> |
getManagedDataSources()
Returns a Collection of DataSourceURLs for all GraphPools managed by this TransactionManager. |
Transaction |
requestTransaction()
Gets the currently active Transaction or initializes a new one if none is currently active. |
Method Detail |
---|
java.util.Collection<DataSourceURL> getManagedDataSources() throws TransactionException
TransactionException
- if something goes wrong.Transaction createTransaction() throws TransactionException
Transaction
object for the specific implementation. If a transaction is already active,
this creates either a nested transaction or throws an exception (if nested transactions are not supported).
Transaction
instance (never null
).
TransactionException
- if something goes wrong.Transaction getCurrentTransaction() throws TransactionException
Transaction
, if any.
A transaction is considered the current one if it is not in state Transaction.State.PRECOMMIT
,
Transaction.State.COMMITTED
or Transaction.State.ROLLED_BACK
, and has no active nested
transactions.
Transaction
instance or null
if none is active at the moment.
TransactionException
- if something goes wrong.Transaction requestTransaction() throws TransactionException
Transaction
or initializes a new one if none is currently active.
This convenience method is a simple combination of getCurrentTransaction()
with an optional
createTransaction()
.
Transaction
instance (never null
).
TransactionException
- if something goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |