org.datanucleus
Interface UserTransaction

public interface UserTransaction

UserTransaction is the interface exposed by JPOX to User Applications.
It allows proprietary JPOX 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).

TRANSACTION_NONE

TRANSACTION_READ_UNCOMMITTED

static final int TRANSACTION_READ_UNCOMMITTED

A constant indicating that
dirty reads, non-repeatable reads and phantom reads can occur.
This level allows a row changed by one transaction to be read
by another transaction before any changes in that row have been
committed (a "dirty read"). If any of the changes are rolled back,
the second transaction will have retrieved an invalid row.

TRANSACTION_REPEATABLE_READ

static final int TRANSACTION_REPEATABLE_READ

A constant indicating that
dirty reads and non-repeatable reads are prevented; phantom
reads can occur. This level prohibits a transaction from
reading a row with uncommitted changes in it, and it also
prohibits the situation where one transaction reads a row,
a second transaction alters the row, and the first transaction
rereads the row, getting different values the second time
(a "non-repeatable read").

TRANSACTION_SERIALIZABLE

static final int TRANSACTION_SERIALIZABLE

A constant indicating that
dirty reads, non-repeatable reads and phantom reads are prevented.
This level includes the prohibitions in
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.

useUpdateLockOnFetch

void useUpdateLockOnFetch()

Turn on serialized access to data fetch from datastore.
Calling this in the middle of a transaction will only affect data read after it.
Some datastores do not support Update Lock feature, and for such datastores
this setting is silently ignored.

setUseUpdateLock

void setUseUpdateLock(boolean lock)

Turn on/off serialized access to data fetch from datastore.
Calling this in the middle of a transaction will only affect data read after it.
Some datastores do not support Update Lock feature, and for such datastores
this setting is silently ignored.

Parameters:

lock - whether to lock data or not

setTransactionIsolation

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.
Calling this in the middle of a transaction has behaviour undetermined