@Component public class TransactionService extends Object
Transaction service which is able to
create/commit/rollback Transaction objects
A Scheduled annotation is used for removing timed out Transactions| Modifier and Type | Field and Description |
|---|---|
static long |
REAP_INTERVAL |
| Constructor and Description |
|---|
TransactionService() |
| Modifier and Type | Method and Description |
|---|---|
Transaction |
beginTransaction(javax.jcr.Session sess)
Create a new Transaction and add it to the currently open ones
|
Transaction |
commit(String txid)
Commit a
Transaction with the given id |
boolean |
exists(String txid)
Check if a Transaction exists
|
Transaction |
getTransaction(String txid)
Retrieve an open
Transaction |
void |
removeAndRollbackExpired()
Every REAP_INTERVAL milliseconds, check for expired transactions.
|
Transaction |
rollback(String txid)
Roll a
Transaction back |
public static final long REAP_INTERVAL
@Scheduled(fixedRate=1000L) public void removeAndRollbackExpired()
public Transaction beginTransaction(javax.jcr.Session sess)
sess - The session to use for this TransactionTransactionpublic Transaction getTransaction(String txid) throws TransactionMissingException
Transactiontxid - the Id of the TransactionTransactionTransactionMissingExceptionpublic boolean exists(String txid)
txid - the Id of the TransactionTransactionpublic Transaction commit(String txid) throws javax.jcr.RepositoryException
Transaction with the given idtxid - the id of the Transactionjavax.jcr.RepositoryExceptionpublic Transaction rollback(String txid) throws javax.jcr.RepositoryException
Transaction backtxid - the id of the TransactionTransaction objectjavax.jcr.RepositoryException - if the Transaction could not be foundCopyright © 2013 DuraSpace, Inc.. All Rights Reserved.