Skip to content

Commit

Permalink
Update PoolDataSourceStatistics.java
Browse files Browse the repository at this point in the history
  • Loading branch information
paulissoft committed Jul 3, 2024
1 parent 2c596fc commit 21d406b
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,16 +513,18 @@ void signalSQLException(final SimplePoolDataSource pds, final SQLException ex) {
try {
if (pds != null && ex != null) {
final long nrOccurrences = signalSQLException(ex);

// show the message
logger.error("getConnection() raised occurrence # {} for this SQL exception: class={}, error code={}, SQL state={}. " +
"Pool: {}, error message: {}",
nrOccurrences,
ex.getClass().getSimpleName(),
ex.getErrorCode(),
ex.getSQLState(), // may be null
pds.getPoolName(),
ex.getMessage());

if (nrOccurrences > 0L) {
// show the message
logger.error("getConnection() raised occurrence # {} for this SQL exception: class={}, error code={}, SQL state={}. " +
"Pool: {}, error message: {}",
nrOccurrences,
ex.getClass().getSimpleName(),
ex.getErrorCode(),
ex.getSQLState(), // may be null
pds.getPoolName(),
ex.getMessage());
}
}
} catch (Exception e) {
logger.error("Exception in signalSQLException():", e);
Expand Down Expand Up @@ -555,12 +557,14 @@ void signalException(final SimplePoolDataSource pds, final Exception ex) {
if (pds != null && ex != null) {
final long nrOccurrences = signalException(ex);

// show the message
logger.error("getConnection() raised occurrence # {} for this exception: class={}. Pool: {}, error message: {}",
nrOccurrences,
ex.getClass().getSimpleName(),
pds.getPoolName(),
ex.getMessage());
if (nrOccurrences > 0L) {
// show the message
logger.error("getConnection() raised occurrence # {} for this exception: class={}. Pool: {}, error message: {}",
nrOccurrences,
ex.getClass().getSimpleName(),
pds.getPoolName(),
ex.getMessage());
}
}
} catch (Exception e) {
logger.error("Exception in signalException():", e);
Expand Down

0 comments on commit 21d406b

Please sign in to comment.