Created
February 15, 2011 20:17
-
-
Save MikaelAmborn/828158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpringConnection implements Connection { | |
private final DataSource dataSource; | |
private final Connection conn; | |
public SpringConnection(DataSource dataSource, Connection conn) { | |
this.dataSource = dataSource; | |
this.conn = conn; | |
} | |
public void commit() throws SQLException { | |
// Do nothing! | |
} | |
/** | |
* calls DataSourceUtils.closeConnectionIfNecessary rather than directly closing the connection | |
*/ | |
public void close() throws SQLException { | |
DataSourceUtils.releaseConnection(conn, dataSource); | |
} | |
//Lots of methods here that just delegats to the conn instance variable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment