org.mule.module.db.internal.domain.connection
Class TransactionalDbConnectionFactory

java.lang.Object
  extended by org.mule.module.db.internal.domain.connection.TransactionalDbConnectionFactory
All Implemented Interfaces:
DbConnectionFactory

public class TransactionalDbConnectionFactory
extends Object
implements DbConnectionFactory

Creates connections using a DbTransactionManager to track active transactions.


Field Summary
protected  DbConfig dbConfig
           
protected  DbTransactionManager dbTransactionManager
           
protected  DbTypeManager dbTypeManager
           
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
TransactionalDbConnectionFactory(DbConfig dbConfig, DbTransactionManager dbTransactionManager, DbTypeManager dbTypeManager)
           
 
Method Summary
 DbConnection createConnection(TransactionalAction transactionalAction)
          Creates a connection with a given TransactionalAction
protected  DbConnection doCreateDbConnection(Connection connection, TransactionalAction transactionalAction)
           
 void releaseConnection(DbConnection connection)
          Indicates that the connection is not used anymore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

dbConfig

protected final DbConfig dbConfig

dbTransactionManager

protected final DbTransactionManager dbTransactionManager

dbTypeManager

protected final DbTypeManager dbTypeManager
Constructor Detail

TransactionalDbConnectionFactory

public TransactionalDbConnectionFactory(DbConfig dbConfig,
                                        DbTransactionManager dbTransactionManager,
                                        DbTypeManager dbTypeManager)
Method Detail

createConnection

public DbConnection createConnection(TransactionalAction transactionalAction)
                              throws SQLException
Description copied from interface: DbConnectionFactory
Creates a connection with a given TransactionalAction

Specified by:
createConnection in interface DbConnectionFactory
Parameters:
transactionalAction - indicates whether or not the factory should look at active transactions in order to lookup for already created connections
Returns:
a connection for the given TransactionalAction
Throws:
SQLException - when not able to obtain a new connection

doCreateDbConnection

protected DbConnection doCreateDbConnection(Connection connection,
                                            TransactionalAction transactionalAction)

releaseConnection

public void releaseConnection(DbConnection connection)
Description copied from interface: DbConnectionFactory
Indicates that the connection is not used anymore

Specified by:
releaseConnection in interface DbConnectionFactory
Parameters:
connection - connection to release


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.