org.wso2.carbon.registry.core.jdbc.utils
Class Transaction

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.utils.Transaction

public class Transaction
extends Object

This is the base class that manages the transactional database operations of the Registry. The transactions API of the Registry is capable of handling nested transactions. If a nested transaction is rollbacked, the whole outer transaction would also be rollbacked, so that the database will not be in an inconsistent state.

The transaction API also supports transactions across multiple databases. This allows various portions of the Registry to be mounted from various databases and work as a part of a single tree.

The transaction is session scoped, and therefore, is available only on a single running thread. Multiple threads would have its own transaction and thereby make it possible to manage concurrency at a much lower level.


Constructor Summary
Transaction()
           
 
Method Summary
static void init(DataAccessManager dataAccessManager)
          Initializes the Transaction Object.
static boolean isStarted()
          Method to determine whether a transaction is started or not.
static void popTransaction()
          Pop stacked transaction and replace the existing one with that.
static void pushTransaction()
          Push current transaction to a stack and make room for a new one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transaction

public Transaction()
Method Detail

init

public static void init(DataAccessManager dataAccessManager)
Initializes the Transaction Object. This method is responsible of initializing the database transactions, which is required for executing queries in the future.

Parameters:
dataAccessManager - the data access manager to be used to communicate with the database.

pushTransaction

public static void pushTransaction()
Push current transaction to a stack and make room for a new one.


popTransaction

public static void popTransaction()
Pop stacked transaction and replace the existing one with that.


isStarted

public static boolean isStarted()
Method to determine whether a transaction is started or not.

Returns:
whether a transaction is started or not.


Copyright © 2011 WSO2 Inc. All Rights Reserved.