|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseTransactionFactoryImpl
public abstract class DatabaseTransactionFactoryImpl
Base class for implementation of database transaction factories.
| Field Summary | |
|---|---|
protected static boolean |
s_bTransactionMonitor
Flag, which is telling us if we should monitor transactions that is use a delegating class which intercepts and monitors calls to UserTransaction class. |
protected static int |
s_iTransactionTimeout
Transaction timeout, which should be set for a transaction when it is started. |
static java.lang.String |
TRANSACTION_MONITOR
Boolean flag, which specifies if the system should monitor transactions that is use a delegating class which intercepts and monitors calls to UserTransaction class. |
static boolean |
TRANSACTION_MONITOR_DEFAULT
Default transaction monitor setting. |
static java.lang.String |
TRANSACTION_TIMEOUT
Transaction timeout in seconds, which should be set for a transaction when it is started. |
static int |
TRANSACTION_TIMEOUT_DEFAULT
Default transaction timeout. |
| Constructor Summary | |
|---|---|
DatabaseTransactionFactoryImpl()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
commitTransaction(java.sql.Connection cntConnection)
Commit implicit transaction for given connection. |
static DatabaseTransactionFactory |
getInstance()
Get the default factory. |
boolean |
isTransactionInProgress()
Test if transaction is in progress. |
boolean |
isTransactionMonitored()
Test if transaction should be monitored |
protected java.sql.Connection |
requestTransactionalConnection(boolean bAutoCommit,
java.lang.String strDataSourceName,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseConnectionFactoryImpl connectionFactory)
This method should be exclusively used by DatabaseConnectionFactoryImpl to get a transaction aware version of a connection. |
protected void |
returnTransactionalConnection(java.sql.Connection cntDBConnection,
DatabaseConnectionFactoryImpl connectionFactory)
This method should be exclusively used by DatabaseConnectionFactoryImpl to get a transaction aware version of a connection. |
void |
rollbackTransaction(java.sql.Connection cntConnection)
Rollback implicit transaction for given connection. |
static void |
setInstance(DatabaseTransactionFactory defaultFactory)
Set default factory instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opensubsystems.core.util.TransactionFactory |
|---|
getTransactionManager, requestTransaction, reset, stop |
| Field Detail |
|---|
public static final java.lang.String TRANSACTION_TIMEOUT
public static final java.lang.String TRANSACTION_MONITOR
public static final int TRANSACTION_TIMEOUT_DEFAULT
public static final boolean TRANSACTION_MONITOR_DEFAULT
protected static int s_iTransactionTimeout
protected static boolean s_bTransactionMonitor
| Constructor Detail |
|---|
public DatabaseTransactionFactoryImpl()
| Method Detail |
|---|
public static DatabaseTransactionFactory getInstance()
throws OSSException
OSSException - - an error has occuredpublic static void setInstance(DatabaseTransactionFactory defaultFactory)
defaultFactory - - new default factory instancegetInstance()
public void commitTransaction(java.sql.Connection cntConnection)
throws java.sql.SQLException
commitTransaction in interface DatabaseTransactionFactorycntConnection - - the connection to commit transaction for.
java.sql.SQLException - - problem commiting transaction
public void rollbackTransaction(java.sql.Connection cntConnection)
throws java.sql.SQLException
rollbackTransaction in interface DatabaseTransactionFactorycntConnection - - the connection to rollback transaction for.
java.sql.SQLException - - problem rolling back transaction
public boolean isTransactionInProgress()
throws javax.transaction.SystemException,
OSSException
javax.transaction.SystemException - - error occured while getting the transaction status
OSSException - - error occured while getting the transaction statuspublic boolean isTransactionMonitored()
protected java.sql.Connection requestTransactionalConnection(boolean bAutoCommit,
java.lang.String strDataSourceName,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseConnectionFactoryImpl connectionFactory)
throws OSSDatabaseAccessException
bAutoCommit - - The desired autocommit state of the connection. If
this connection is invoked in global (JTA) transaction
then the autocommit is false regardless of what
value is specified here. Use true here if the client
only reads the data and false if the client also
modifies the data.strDataSourceName - - datasource for which the connection was requested,
if null then it is requested for default data sourcestrUser - - user for which the connection was requested, if null
then it is requested for default userstrPassword - - password for which the connection was requested, if
null then it is requested for default passwoedconnectionFactory - - connection factory which is requesting the connection
OSSDatabaseAccessException - - an error has occured
protected void returnTransactionalConnection(java.sql.Connection cntDBConnection,
DatabaseConnectionFactoryImpl connectionFactory)
cntDBConnection - - connection to return, can be nullconnectionFactory - - connection factory to which the connection should
be returned
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||