com.github.drinkjava2.jtransactions
Interface ConnectionManager

All Known Implementing Classes:
TinyTxConnectionManager

public interface ConnectionManager

A ConnectionManager implementation determine how to get or release connection from DataSource or ThreadLocal or from Spring or JTA or some container...

Since:
1.0.0
Author:
Yong Zhu

Method Summary
 Connection getConnection(DataSource dataSource)
          A ConnectionManager implementation determine how to get connection from DataSource or ThreadLocal or from Spring or JTA or some container...
 boolean isInTransaction(DataSource dataSource)
          Check if a connection already be get from given dataSource and be cached as it started a Transaction
 void releaseConnection(Connection conn, DataSource dataSource)
          A ConnectionManager implementation determine how to close connection or return connection to ThreadLocal or return to Spring or JTA or some container...
 

Method Detail

getConnection

Connection getConnection(DataSource dataSource)
                         throws SQLException
A ConnectionManager implementation determine how to get connection from DataSource or ThreadLocal or from Spring or JTA or some container...

Throws:
SQLException

releaseConnection

void releaseConnection(Connection conn,
                       DataSource dataSource)
                       throws SQLException
A ConnectionManager implementation determine how to close connection or return connection to ThreadLocal or return to Spring or JTA or some container...

Throws:
SQLException

isInTransaction

boolean isInTransaction(DataSource dataSource)
Check if a connection already be get from given dataSource and be cached as it started a Transaction



Copyright © 2018. All rights reserved.