public class JDBCDatabaseTransaction extends Object implements DatabaseTransaction
Modifier and Type | Class and Description |
---|---|
static class |
JDBCDatabaseTransaction.ManagedRegistryConnection
Wrapped connection that manages connections making it possible to have connections to
multiple databases.
|
Constructor and Description |
---|
JDBCDatabaseTransaction() |
Modifier and Type | Method and Description |
---|---|
void |
decNestedDepth()
This method will decrement the nested depth of the transaction on the current session.
|
static JDBCDatabaseTransaction.ManagedRegistryConnection |
getConnection()
Method to get connection.
|
static JDBCDatabaseTransaction.ManagedRegistryConnection |
getManagedRegistryConnection(Connection conn)
Method to obtain a connection that is managed by the registry transactions implementation.
|
int |
getNestedDepth()
Method to obtain the depth of nesting of this transaction at a given point in time.
|
void |
incNestedDepth()
This method will increment the nested depth of the transaction on the current session.
|
boolean |
isRollbacked()
Method to determine whether this transaction has been rollbacked at least once.
|
boolean |
isStarted()
Method to determine whether a transaction is started or not.
|
void |
popTransaction()
Pop stacked transaction and replace the existing one with that.
|
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.
|
void |
setRollbacked(boolean rollbacked)
Method to set whether this transaction has been rollbacked or not.
|
void |
setStarted(boolean started)
Method to set whether a transaction is started or not.
|
public void pushTransaction()
DatabaseTransaction
pushTransaction
in interface DatabaseTransaction
public void popTransaction()
DatabaseTransaction
popTransaction
in interface DatabaseTransaction
public boolean isStarted()
DatabaseTransaction
isStarted
in interface DatabaseTransaction
public void setStarted(boolean started)
DatabaseTransaction
setStarted
in interface DatabaseTransaction
started
- whether a transaction is started or not.public static JDBCDatabaseTransaction.ManagedRegistryConnection getConnection()
public static void setConnection(Connection connection)
connection
- the connection.public static void removeConnection()
public void incNestedDepth()
DatabaseTransaction
incNestedDepth
in interface DatabaseTransaction
public void decNestedDepth()
DatabaseTransaction
decNestedDepth
in interface DatabaseTransaction
public int getNestedDepth()
DatabaseTransaction
getNestedDepth
in interface DatabaseTransaction
public boolean isRollbacked()
DatabaseTransaction
isRollbacked
in interface DatabaseTransaction
public void setRollbacked(boolean rollbacked)
DatabaseTransaction
setRollbacked
in interface DatabaseTransaction
rollbacked
- whether this transaction has been rollbacked or not.public static JDBCDatabaseTransaction.ManagedRegistryConnection getManagedRegistryConnection(Connection conn)
conn
- un-managed connection.Copyright © 2015 WSO2 Inc. All Rights Reserved.