|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.registry.core.jdbc.utils.Transaction
public class Transaction
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 |
decNestedDepth()
This method will decrement the nested depth of the transaction on the current session. |
static Connection |
getConnection()
Method to get connection. |
static Connection |
getManagedRegistryConnection(Connection conn)
Method to obtain a connection that is managed by the registry transactions implementation. |
static int |
getNestedDepth()
Method to obtain the depth of nesting of this transaction at a given point in time. |
static void |
incNestedDepth()
This method will increment the nested depth of the transaction on the current session. |
static boolean |
isRollbacked()
Method to determine whether this transaction has been rollbacked at least once. |
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. |
static void |
removeConnection()
Method to remove the connection from the transaction. |
static void |
setConnection(Connection connection)
Method to set connection. |
static void |
setRollbacked(boolean rollbacked)
Method to set whether this transaction has been rollbacked or not. |
static void |
setStarted(boolean started)
Method to set whether a transaction is started or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Transaction()
Method Detail |
---|
public static void pushTransaction()
public static void popTransaction()
public static boolean isStarted()
public static void setStarted(boolean started)
started
- whether a transaction is started or not.public static Connection getConnection()
public static void setConnection(Connection connection)
connection
- the connection.public static void removeConnection()
public static void incNestedDepth()
public static void decNestedDepth()
public static int getNestedDepth()
public static boolean isRollbacked()
public static void setRollbacked(boolean rollbacked)
rollbacked
- whether this transaction has been rollbacked or not.public static Connection getManagedRegistryConnection(Connection conn)
conn
- un-managed connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |