|
|||||||||
| 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.JOTMTransactionFactoryImpl
public class JOTMTransactionFactoryImpl
Transaction factory using JOTM transaction manager from Objectweb (http://www.objectweb.org/jotm/index.html)
| Field Summary | |
|---|---|
protected boolean |
m_bStarted
True if transaction factory is started. |
protected org.objectweb.transaction.jta.TMService |
m_tmJotm
Instance of JOTM transaction manager. |
| 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 | |
|---|---|
JOTMTransactionFactoryImpl()
Create new transaction factory. |
|
| Method Summary | |
|---|---|
javax.transaction.TransactionManager |
getTransactionManager()
Get transaction manager for this factory. |
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. |
protected void |
start()
Start the transaction manager. |
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 |
|---|
protected org.objectweb.transaction.jta.TMService m_tmJotm
protected boolean m_bStarted
| Constructor Detail |
|---|
public JOTMTransactionFactoryImpl()
| Method Detail |
|---|
public javax.transaction.TransactionManager getTransactionManager()
public javax.transaction.UserTransaction requestTransaction()
throws OSSException
OSSException - - an error has occured
public void reset()
throws OSSException
OSSException - - an error has occured during reset
public void stop()
throws OSSException
OSSException - - problem stoping transaction factory.protected void start()
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 | ||||||||