On 5/4/2018 6:15 PM, Shawn Heisey wrote:
> The implementation looks clean to me, but I need something bad to happen
> before I will know if it's actually working.

I added a background thread that periodically logs pool stats.  At
first, I never got it to line up with any actual database usage, and I
never saw any queries in the stats.  By fiddling with the exact timing
for the first logging loop, I was able to get the pool stats to show me
one of the the SQL queries that the program uses when it first starts up.

Before I confirmed that, I did put a sanity check in to log all entries
*removed* from the map, which showed me that queries were indeed being
added.  The second line of this log excerpt (and a whole bunch of other
lines) shows an SQL query being removed:

https://apaste.info/dJK0

(the QC abbreviation means "quietClose" ... the name of the method where
I added the sanity-check logging.)

Looks like I've got it doing what I want, and if any SQL queries are
underway when an alarm is fired, they should be in the email.  So I have
a solution, and there should be enough information in this thread to
help others do the same.

I do wonder if similar SQL query tracking would be in-scope for DBCP
datasource objects.

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

Reply via email to