|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseTransactionFactoryImpl
org.opensubsystems.core.persist.db.transaction.J2EETransactionFactoryImpl
public class J2EETransactionFactoryImpl
Transaction factory using J2EE transaction manager. It will connect and expose the existing transaction manager of the J2EE server under which it currently runs.
| Field Summary | |
|---|---|
static java.lang.String[] |
ARR_TRAN_MANAGER
An array of object references to the JNDI location of TransactionManager. |
static java.lang.String[] |
ARR_USER_TRAN
An array of object references to the JNDI location of UserTransaction. |
protected javax.transaction.TransactionManager |
m_currentTransactionManager
Current TransactionManager that is used for actual j2ee server. |
protected javax.transaction.UserTransaction |
m_currentUserTransaction
Current UserTransaction that is used for actual j2ee server. |
| Fields inherited from class org.opensubsystems.core.persist.db.DatabaseTransactionFactoryImpl |
|---|
s_bTransactionMonitor, s_iTransactionTimeout, TRANSACTION_MONITOR, TRANSACTION_MONITOR_DEFAULT, TRANSACTION_TIMEOUT, TRANSACTION_TIMEOUT_DEFAULT |
| Constructor Summary | |
|---|---|
J2EETransactionFactoryImpl()
|
|
| Method Summary | |
|---|---|
javax.transaction.TransactionManager |
getTransactionManager()
Get transaction manager for this factory. |
protected javax.transaction.TransactionManager |
lookupTransactionManager(java.lang.String transactionManagerName)
Look up the TransactionManager in JNDI via the configured name. |
protected javax.transaction.UserTransaction |
lookupUserTransaction(java.lang.String userTransactionName)
Look up the UserTransaction in JNDI via the configured name. |
javax.transaction.UserTransaction |
requestTransaction()
Get transaction object which we can use to begin/commit/rollback transactions. |
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. |
void |
reset()
This method is here mainly for testing and it should reset the transaction manager to initial status to that tests can start from known environment instead of being influenced by other tests. |
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 |
stop()
Stop the transaction factory. |
| Methods inherited from class org.opensubsystems.core.persist.db.DatabaseTransactionFactoryImpl |
|---|
commitTransaction, getInstance, isTransactionInProgress, isTransactionMonitored, rollbackTransaction, setInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String[] ARR_TRAN_MANAGER
public static final java.lang.String[] ARR_USER_TRAN
protected javax.transaction.UserTransaction m_currentUserTransaction
protected javax.transaction.TransactionManager m_currentTransactionManager
| Constructor Detail |
|---|
public J2EETransactionFactoryImpl()
| Method Detail |
|---|
public javax.transaction.UserTransaction requestTransaction()
throws OSSException
OSSException - - an error has occuredpublic javax.transaction.TransactionManager getTransactionManager()
public void reset()
throws OSSException
OSSException - - an error has occured during reset
public void stop()
throws OSSException
OSSException - - problem stoping transaction factory.protected javax.transaction.UserTransaction lookupUserTransaction(java.lang.String userTransactionName)
userTransactionName - - the JNDI name of the UserTransaction
protected javax.transaction.TransactionManager lookupTransactionManager(java.lang.String transactionManagerName)
transactionManagerName - - the JNDI name of the TransactionManager
protected java.sql.Connection requestTransactionalConnection(boolean bAutoCommit,
java.lang.String strDataSourceName,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseConnectionFactoryImpl connectionFactory)
throws OSSDatabaseAccessException
requestTransactionalConnection in class DatabaseTransactionFactoryImplbAutoCommit - - 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)
returnTransactionalConnection in class DatabaseTransactionFactoryImplcntDBConnection - - 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 | ||||||||