Re: [c3p0-users] Checking that Prepared statements are being reused
Status: Beta
Brought to you by:
swaldman
From: Paul T. <pau...@fa...> - 2009-10-29 09:28:35
|
Steve Waldman wrote: > > On Oct 28, 2009, at 12:21 PM, Paul Taylor wrote: >> 3. I have a profiler/debugger , is there something I could look for >> in the stack to identify whether or not its reusing the statement. > > NewProxyConnection.prepareStatement(...) -> > NewPooledConnection.checkoutStatement(...) -> > GooGooStatementCache.checkoutStatement( ... ) > Thx yes it was working (I think the issue is somewhere else after all), I then tried disabling maxStatementsPerConnection, then the path becomes NewProxyConnection.prepareStatement(...) -> Embedconnection.prepareStatement(...) One thing I don't get is that with my program I d expect there to be one path of : NewProxyConnection.prepareStatement(...) -> Embedconnection.prepareStatement(...) Per pooled connection using this statement (for when it initially gets created) then NewProxyConnection.prepareStatement(...) -> NewPooledConnection.checkoutStatement(...) -> GooGooStatementCache.checkoutStatement( ... ) for the remaining statements but this doesn't seem to happen I call a particular prepared statement for every file I load into the program, its the same code calling the prepared statement so is identical every time. Running against 464 files with a profiler (Yourkit Java Profiler) I can see: Songcache.addToDatabase : 464 calls (my method) NewProxyConnection.prepareStatement(): 464 calls NewPooledConnection.checkoutStatement(): 464 calls GooGooStatementCache.checkoutStatement(): 464 calls NewProxyConnection.executeUpdate():464 calls there were no calls to Embedconnection.prepareStatement(...) ! Paul |