public class ConnectionPoolHealthSqlInterceptor extends Object implements org.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptor
We log a warning or error message when:
3, but becomes 2 if in STRICT_MODE.DANGER_ZONE.| Modifier and Type | Field and Description |
|---|---|
static String |
DANGER_ZONE
The minimum number of connections that must still be available for it to be considered safe to request
a second connection.
|
static String |
QUIET
Forces all logging to be at the debug level instead of the warning level.
|
static String |
STRICT_MODE
Lowers the threshold of what constitutes "too many connections" from
3 to 2 so that we can
be even more aggressive in tracking down code that consumes multiple connections. |
| Constructor and Description |
|---|
ConnectionPoolHealthSqlInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterSuccessfulExecution(String sqlString,
List<String> parameterValues,
Statement statement,
ResultSet resultSet,
int rowsUpdated) |
void |
beforeExecution(String sqlString,
List<String> parameterValues,
Statement statement) |
void |
onConnectionReplaced(Connection connection,
org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState) |
void |
onConnectionTaken(Connection connection,
org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState) |
void |
onException(String sqlString,
List<String> parameterValues,
Statement statement,
SQLException sqlException) |
public static final String DANGER_ZONE
STRICT_MODE, we would normally only log when 3 or more
connections are requested at once; however, if the pool is within the "danger zone" of being exhausted,
then even requesting just 2 connections is considered as a deadlock risk.
Default: 2
public static final String QUIET
public static final String STRICT_MODE
3 to 2 so that we can
be even more aggressive in tracking down code that consumes multiple connections. Be forewarned that there
are known places where multiple connections are deliberately used at times, such as when indexing issues,
creating an issue, or populating an ID bank for OfBiz, so the signal-to-noise ratio may be disappointing.
Default: false
public void onConnectionTaken(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState)
onConnectionTaken in interface org.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptorpublic void onConnectionReplaced(Connection connection, org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionPoolState connectionPoolState)
onConnectionReplaced in interface org.ofbiz.core.entity.jdbc.interceptors.connection.SQLConnectionInterceptorpublic void beforeExecution(String sqlString, List<String> parameterValues, Statement statement)
beforeExecution in interface org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptorpublic void afterSuccessfulExecution(String sqlString, List<String> parameterValues, Statement statement, ResultSet resultSet, int rowsUpdated)
afterSuccessfulExecution in interface org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptorpublic void onException(String sqlString, List<String> parameterValues, Statement statement, SQLException sqlException)
onException in interface org.ofbiz.core.entity.jdbc.interceptors.SQLInterceptorCopyright © 2002-2017 Atlassian. All Rights Reserved.