Re: [Proxool-developer] SQL statement from the Connection
UNMAINTAINED!
Brought to you by:
billhorsman
From: Bill H. <bi...@lo...> - 2003-11-14 16:10:48
|
Hi Vick, On Fri, 2003-11-14 at 15:51, xyz abc wrote: > Unfortunately, onExecute() never "gets completed" if there is a DB Block. > Would it be more effective to split the onExecute() into > onExecuteStart(String command) and onExecuteFinish(String command, long > elapsedtime)? Yep, that's a good point. It would mean changing the public API for Proxool which isn't something we do lightly though. There is another option for you which might work. Have you investigated ProxoolFacade.getSnapshot()? This will give you a list of all connections and tell you how long each one has been active for. See ConnectionInfoIF.getTimeLastStartActive(). If you are in a servlet environment then you can see this information by using the bundled AdminServlet. Unfortunately, this doesn't tell you the SQL it was performing but it does tell you the name of the thread that is using that connection - ConnectionInfoIF.getRequester(). I think the best thing to do would be to add a new method to ConnectionInfoIF called getSql() that tells you what SQL is currently being executed. That would be really interesting - I can't believe I haven't thought of it before. And because ConnectionInfoIF is implemented internally it could be done without breaking backwards compatibility. Performance impact would be negligible. You would have to turn on the "trace" property to see this extra information anyway. Anybody any thoughts on this? Cheers, Bill |