Class AbstractLeakHunter
- java.lang.Object
-
- com.github.database.rider.core.leak.AbstractLeakHunter
-
- All Implemented Interfaces:
LeakHunter
- Direct Known Subclasses:
MsSqlLeakHunter
public abstract class AbstractLeakHunter extends Object implements LeakHunter
Created by pestano on 07/09/16.
-
-
Field Summary
Fields Modifier and Type Field Description protected Connectionconnection
-
Constructor Summary
Constructors Constructor Description AbstractLeakHunter(Connection connection, String methodName, boolean cacheConnection)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckConnectionsAfterExecution()Check number of opened jdbc connections/sessionsprotected abstract StringleakCountSql()intmeasureConnectionsBeforeExecution()intopenConnections()
-
-
-
Field Detail
-
connection
protected final Connection connection
-
-
Constructor Detail
-
AbstractLeakHunter
public AbstractLeakHunter(Connection connection, String methodName, boolean cacheConnection)
-
-
Method Detail
-
openConnections
public int openConnections()
- Specified by:
openConnectionsin interfaceLeakHunter- Returns:
- number of opened jdbc connections/sessions
-
measureConnectionsBeforeExecution
public int measureConnectionsBeforeExecution()
- Specified by:
measureConnectionsBeforeExecutionin interfaceLeakHunter- Returns:
- number of opened jdbc connections/sessions
-
checkConnectionsAfterExecution
public void checkConnectionsAfterExecution() throws LeakHunterExceptionDescription copied from interface:LeakHunterCheck number of opened jdbc connections/sessions- Specified by:
checkConnectionsAfterExecutionin interfaceLeakHunter- Throws:
LeakHunterException- if the number of connections is greater than before execution
-
leakCountSql
protected abstract String leakCountSql()
-
-