public interface Transaction
Identifies and provides methods to complete a transaction.
To use Transaction, an application must authenticate as rest-writer or rest-admin.
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Completes the transaction, making writes and deletes visible to other database clients.
|
List<javax.ws.rs.core.NewCookie> |
getCookies()
Returns any cookies sent in the response to open the transaction.
|
String |
getHostId()
Returns the host identifier for the transaction that binds this transaction with the host e-node for the transaction.
|
String |
getTransactionId()
Returns the identifier for the transaction.
|
<T extends StructureReadHandle> |
readStatus(T handle)
Reads the status for the transaction including whether the transaction has timed out.
|
void |
rollback()
Cancels the transaction, reverting the database to its state prior to the writes and deletes made in the transaction.
|
String getTransactionId()
Returns the identifier for the transaction. Ordinarily, you don’t need to get the transaction id. Instead, you pass the Transaction object to methods.
String getHostId()
Returns the host identifier for the transaction that binds this transaction with the host e-node for the transaction. Ordinarily, you will not need to do anything with the host id. Instead, you pass the Transaction object to methods.
List<javax.ws.rs.core.NewCookie> getCookies()
Returns any cookies sent in the response to open the transaction. This is specifically to support cookies used by a load balancer to keep all requests associated with a transaction on the host where that transaction originated.
<T extends StructureReadHandle> T readStatus(T handle) throws ForbiddenUserException, FailedRequestException
Reads the status for the transaction including whether the transaction has timed out.
T - the type of StructureReadHandle handle to returnhandle - a JSON or XML handle on the content of the status reportForbiddenUserExceptionFailedRequestExceptionvoid commit()
throws ForbiddenUserException,
FailedRequestException
Completes the transaction, making writes and deletes visible to other database clients.
To call commit(), an application must authenticate as rest-writer or rest-admin.
void rollback()
throws ForbiddenUserException,
FailedRequestException
Cancels the transaction, reverting the database to its state prior to the writes and deletes made in the transaction.
To call rollback(), an application must authenticate as rest-writer or rest-admin.
Copyright © 2013-2017 MarkLogic Corporation.