|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UserTransaction
UserTransaction is the interface exposed to User Applications.
It allows proprietary extensions to be used by user applications.
To exemplify the usage of this interface, the below is a JDO snippet:
Transaction tx = pm.currentTransaction();
((UserTransaction)tx).setUseUpdateLock(true);
This interface does not make any distinction between user APIs, such as
JDO or JPA, neither the datastores, such as RDBMS or DB4O. Unsupported
operations will throw UnsupportedOperationException.
User applications must be aware that the behaviour of this interface and
effects caused by invoking these operations may not be portable between
different datastores kinds (RBDMS, DB4O, LDAP, etc )or datastores of same
kind (RDBMS Oracle, RDBMS DB2, RDBMS MySQL, RDBMS Derby, etc).
| Field Summary | |
|---|---|
static int |
TRANSACTION_NONE
A constant indicating that transactions are not supported. |
static int |
TRANSACTION_READ_COMMITTED
A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur. |
static int |
TRANSACTION_READ_UNCOMMITTED
A constant indicating that dirty reads, non-repeatable reads and phantom reads can occur. |
static int |
TRANSACTION_REPEATABLE_READ
A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur. |
static int |
TRANSACTION_SERIALIZABLE
A constant indicating that dirty reads, non-repeatable reads and phantom reads are prevented. |
| Method Summary | |
|---|---|
void |
setTransactionIsolation(int isolation)
Configure isolation level for the transaction Some datastores do not support Isolation Level feature, and for such datastores this setting is silently ignored. |
void |
setUseUpdateLock(boolean lock)
Turn on/off serialized access to data fetch from datastore. |
void |
useUpdateLockOnFetch()
Turn on serialized access to data fetch from datastore. |
| Field Detail |
|---|
static final int TRANSACTION_NONE
static final int TRANSACTION_READ_UNCOMMITTED
static final int TRANSACTION_READ_COMMITTED
static final int TRANSACTION_REPEATABLE_READ
static final int TRANSACTION_SERIALIZABLE
TRANSACTION_REPEATABLE_READ and further prohibits the
situation where one transaction reads all rows that satisfy
a WHERE condition, a second transaction inserts a row that
satisfies that WHERE condition, and the first transaction
rereads for the same condition, retrieving the additional
"phantom" row in the second read.
| Method Detail |
|---|
void useUpdateLockOnFetch()
void setUseUpdateLock(boolean lock)
lock - whether to lock data or notvoid setTransactionIsolation(int isolation)
isolation - level
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||