public class TransactionalDbConnectionFactory extends Object implements DbConnectionFactory
DbTransactionManager
to track active transactions.Modifier and Type | Field and Description |
---|---|
protected DbTransactionManager |
dbTransactionManager |
protected DbTypeManager |
dbTypeManager |
protected Log |
logger |
Constructor and Description |
---|
TransactionalDbConnectionFactory(DbTransactionManager dbTransactionManager,
DbTypeManager dbTypeManager,
ConnectionFactory connectionFactory,
DataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
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
|
protected final Log logger
protected final DbTransactionManager dbTransactionManager
protected final DbTypeManager dbTypeManager
public TransactionalDbConnectionFactory(DbTransactionManager dbTransactionManager, DbTypeManager dbTypeManager, ConnectionFactory connectionFactory, DataSource dataSource)
public DbConnection createConnection(TransactionalAction transactionalAction) throws SQLException
DbConnectionFactory
TransactionalAction
createConnection
in interface DbConnectionFactory
transactionalAction
- indicates whether or not the factory should
look at active transactions in order to lookup
for already created connectionsTransactionalAction
SQLException
- when not able to obtain a new connectionprotected DbConnection doCreateDbConnection(Connection connection, TransactionalAction transactionalAction)
public void releaseConnection(DbConnection connection)
DbConnectionFactory
releaseConnection
in interface DbConnectionFactory
connection
- connection to releaseCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.