Top Description Fields Constructors Methods
org.apache.derby.iapi.transaction

public final Class TransactionControl

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Iterator, org.apache.derby.shared.common.error.ExceptionSeverity, .StandardException, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.shared.common.reference.SQLState

Provide support to transactions to manage sets of actions to perform at transaction boundaries.

Add rollback of savepoints?

Todo

A

Field Summary

Modifier and TypeField and Description
private static final int[]
CS_TO_JDBC_ISOLATION_LEVEL_MAP

Map from Derby transaction isolation constants to JDBC constants.

private static final String[][]
CS_TO_SQL_ISOLATION_MAP

Map from Derby transaction isolation constants to text values used in SQL.

private final ArrayList<TransactionListener>
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addListener(TransactionListener listener)

Add a listener to the curent transaction.

public static int
isolationMapCount()

Get number of isolation string mappings

public static String[]
isolationTextNames(int derbyIsolationLevel)

Map Derby isolation level to SQL text values

public static int
jdbcIsolationLevel(int derbyIsolationLevel)

Map a Derby isolation level to the corresponding JDBC level

public void
preCommitNotify()

Notify all listeners that a commit is about to occur.

public void
preRollbackNotify()

Notify all listeners that a rollback is about to occur.

public void
removeListener(TransactionListener listener)

Remove a listener from the current transaction.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CS_TO_JDBC_ISOLATION_LEVEL_MAPback to summary
private static final int[] CS_TO_JDBC_ISOLATION_LEVEL_MAP

Map from Derby transaction isolation constants to JDBC constants.

CS_TO_SQL_ISOLATION_MAPback to summary
private static final String[][] 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.

listenersback to summary
private final ArrayList<TransactionListener> listeners
READ_COMMITTED_ISOLATION_LEVELback to summary
public static final int READ_COMMITTED_ISOLATION_LEVEL
READ_UNCOMMITTED_ISOLATION_LEVELback to summary
public static final int READ_UNCOMMITTED_ISOLATION_LEVEL
REPEATABLE_READ_ISOLATION_LEVELback to summary
public static final int REPEATABLE_READ_ISOLATION_LEVEL
SERIALIZABLE_ISOLATION_LEVELback to summary
public static final int SERIALIZABLE_ISOLATION_LEVEL
UNSPECIFIED_ISOLATION_LEVELback to summary
public static final int UNSPECIFIED_ISOLATION_LEVEL

Constructor Detail

TransactionControlback to summary
public TransactionControl()

Method Detail

addListenerback to summary
public void addListener(TransactionListener listener)

Add a listener to the curent transaction. A listener may be added multiple times and it will receive multiple callbacks.

isolationMapCountback to summary
public static int isolationMapCount()

Get number of isolation string mappings

isolationTextNamesback to summary
public static String[] isolationTextNames(int derbyIsolationLevel)

Map Derby isolation level to SQL text values

jdbcIsolationLevelback to summary
public static int jdbcIsolationLevel(int derbyIsolationLevel)

Map a Derby isolation level to the corresponding JDBC level

preCommitNotifyback to summary
public void preCommitNotify() throws StandardException

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.

preRollbackNotifyback to summary
public void preRollbackNotify() throws StandardException

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.

removeListenerback to summary
public void removeListener(TransactionListener listener)

Remove a listener from the current transaction.