Class TransactionControl
java.lang.Object
org.apache.derby.iapi.transaction.TransactionControl
Provide support to transactions to manage sets of
actions to perform at transaction boundaries.
Add rollback of savepoints? TODO: A
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]
Map from Derby transaction isolation constants to JDBC constants.private static final String[][]
Map from Derby transaction isolation constants to text values used in SQL.private final ArrayList
<TransactionListener> static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TransactionListener listener) Add a listener to the curent transaction.static int
Get number of isolation string mappingsstatic String[]
isolationTextNames
(int derbyIsolationLevel) Map Derby isolation level to SQL text valuesstatic int
jdbcIsolationLevel
(int derbyIsolationLevel) Map a Derby isolation level to the corresponding JDBC levelvoid
Notify all listeners that a commit is about to occur.void
Notify all listeners that a rollback is about to occur.void
removeListener
(TransactionListener listener) Remove a listener from the current transaction.
-
Field Details
-
UNSPECIFIED_ISOLATION_LEVEL
public static final int UNSPECIFIED_ISOLATION_LEVEL- See Also:
-
READ_UNCOMMITTED_ISOLATION_LEVEL
public static final int READ_UNCOMMITTED_ISOLATION_LEVEL- See Also:
-
READ_COMMITTED_ISOLATION_LEVEL
public static final int READ_COMMITTED_ISOLATION_LEVEL- See Also:
-
REPEATABLE_READ_ISOLATION_LEVEL
public static final int REPEATABLE_READ_ISOLATION_LEVEL- See Also:
-
SERIALIZABLE_ISOLATION_LEVEL
public static final int SERIALIZABLE_ISOLATION_LEVEL- See Also:
-
CS_TO_JDBC_ISOLATION_LEVEL_MAP
private static final int[] CS_TO_JDBC_ISOLATION_LEVEL_MAPMap from Derby transaction isolation constants to JDBC constants. -
CS_TO_SQL_ISOLATION_MAP
Map from Derby transaction isolation constants to text values used in SQL. Note that the text "REPEATABLE READ" or "RR" maps to SERIALIZABLE_ISOLATION_LEVEL as a hang over from DB2 compatibility and now to preserve backwards compatability. -
listeners
-
-
Constructor Details
-
TransactionControl
public TransactionControl()
-
-
Method Details
-
jdbcIsolationLevel
public static int jdbcIsolationLevel(int derbyIsolationLevel) Map a Derby isolation level to the corresponding JDBC level -
isolationTextNames
Map Derby isolation level to SQL text values -
isolationMapCount
public static int isolationMapCount()Get number of isolation string mappings -
addListener
Add a listener to the curent transaction. A listener may be added multiple times and it will receive multiple callbacks. -
removeListener
Remove a listener from the current transaction. -
preCommitNotify
Notify all listeners that a commit is about to occur. If a listener throws an exception then no further listeners will be notified and a StandardException with rollback severity will be thrown.- Throws:
StandardException
-
preRollbackNotify
Notify all listeners that a rollback is about to occur. If a listener throws an exception then no further listeners will be notified and a StandardException with shutdown database(?) severity will be thrown.- Throws:
StandardException
-