com.github.drinkjava2.jtransactions.spring
Class SpringTxConnectionManager
java.lang.Object
com.github.drinkjava2.jtransactions.spring.SpringTxConnectionManager
- All Implemented Interfaces:
- ConnectionManager
public class SpringTxConnectionManager
- extends Object
- implements ConnectionManager
SpringConnectionManager is the implementation of ConnectionManager, get
connection and release connection from Spring environment
- Since:
- 1.0.0
- Author:
- Yong Zhu
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getConnectionMethod
protected final Method getConnectionMethod
releaseConnectionMethod
protected final Method releaseConnectionMethod
getResourceMethod
protected final Method getResourceMethod
SpringTxConnectionManager
public SpringTxConnectionManager()
instance
public static final SpringTxConnectionManager instance()
- Returns:
- A singleton
getConnection
public Connection getConnection(DataSource dataSource)
- Description copied from interface:
ConnectionManager
- A ConnectionManager implementation determine how to get connection from
DataSource or ThreadLocal or from Spring or JTA or some container...
- Specified by:
getConnection in interface ConnectionManager
releaseConnection
public void releaseConnection(Connection conn,
DataSource dataSource)
- Description copied from interface:
ConnectionManager
- A ConnectionManager implementation determine how to close connection or
return connection to ThreadLocal or return to Spring or JTA or some
container...
- Specified by:
releaseConnection in interface ConnectionManager
isInTransaction
public boolean isInTransaction(DataSource ds)
- Description copied from interface:
ConnectionManager
- Check if a connection already be get from given dataSource and be cached as
it started a Transaction
- Specified by:
isInTransaction in interface ConnectionManager
Copyright © 2018. All rights reserved.