org.agileclick.genorm.runtime
Class LeakDetectorDataSource

java.lang.Object
  extended by org.agileclick.genorm.runtime.DataSourceWrapper
      extended by org.agileclick.genorm.runtime.LeakDetectorDataSource
All Implemented Interfaces:
java.sql.Wrapper, javax.sql.CommonDataSource, javax.sql.DataSource

public class LeakDetectorDataSource
extends DataSourceWrapper


Constructor Summary
LeakDetectorDataSource(javax.sql.DataSource ds, int stackStart, int stackStop)
           
 
Method Summary
 java.sql.Connection getConnection()
           
 int listOpenConnections()
          Goes through all open db connections and prints out the ones that are still open.
 
Methods inherited from class org.agileclick.genorm.runtime.DataSourceWrapper
getConnection, getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeakDetectorDataSource

public LeakDetectorDataSource(javax.sql.DataSource ds,
                              int stackStart,
                              int stackStop)
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class DataSourceWrapper
Throws:
java.sql.SQLException

listOpenConnections

public int listOpenConnections()
                        throws java.sql.SQLException
Goes through all open db connections and prints out the ones that are still open. Good for testing and catching open connections. It fails in multi threaded environments where another thread may currently have a db connection open.

Throws:
java.sql.SQLException