public interface DatabaseTransaction
marshal()
and store the result. To retrieve the transaction object
call DatabaseQueryProvider.unmarshalTransaction(byte[])
passing in the marshaled handle.Modifier and Type | Method and Description |
---|---|
void |
commit(long timeout)
Call commit on the connection.
|
byte[] |
marshal()
Return a handle that can be later passed to
DatabaseQueryProvider.unmarshalTransaction(byte[]) . |
void |
rollback(long timeout)
Call rollback on the connection.
|
void |
setTransactionIsolation(int level)
Set a transaction isolation level.
|
void commit(long timeout) throws SQLException, TimeoutException, InsufficientResourcesException, DatabaseQueryException
timeout
- timeout in millisecondsSQLException
- if an SQL exception occurred executing the query or retrieving the result setTimeoutException
- if a timeout occurred waiting for a worker thread or for the database to returnInsufficientResourcesException
- if the request was rejected due to lack of worker threadsDatabaseQueryException
- for any other problemvoid rollback(long timeout) throws SQLException, TimeoutException, DatabaseQueryException, InsufficientResourcesException
timeout
- timeout in millisecondsSQLException
- if an SQL exception occurred executing the query or retrieving the result setTimeoutException
- if a timeout occurred waiting for a worker thread or for the database to returnInsufficientResourcesException
- if the request was rejected due to lack of worker threadsDatabaseQueryException
- for any other problembyte[] marshal()
DatabaseQueryProvider.unmarshalTransaction(byte[])
.void setTransactionIsolation(int level)
Connection.setTransactionIsolation(int)
when a connection is first retrieved for this transaction.
The constants defined in the interface Connection
are the possible transaction isolation levels.
level
- one of the following Connection
constants:
Connection.TRANSACTION_READ_UNCOMMITTED
,
Connection.TRANSACTION_READ_COMMITTED
,
Connection.TRANSACTION_REPEATABLE_READ
, or
Connection.TRANSACTION_SERIALIZABLE
.
(Note that Connection.TRANSACTION_NONE
cannot be used
because it specifies that transactions are not supported.)