Hi Ralph and Steven, Obsession pays. You were right -- I haven't been able to find a way to track connections from code. I gave up and resolved to try to use connection pools in the future. And yet... I've just randomly stumbled upon this tool (http://www.p6spy.com/) . It seems to put a layer between my code and the JDBC driver, for debugging purposes. This freeware tool promises to help me track calls to open connections, calculate how long all of the db calls take, and make my bed in the morning too. I haven't tried it yet, and it will be a long time before I can afford the time to check it out, but I wanted to share my wondrous finding with the folks who helped me understand JDBC connections way back in June.
Thanks a lot, Darya. On Wed, 5 Jun 2002, Steven Wood wrote: > ------=_NextPart_000_0044_01C20CAB.2E2012B0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: 8bit > > Hi, > > If you use the javax.sql extension API you can be notified whenever a > connection is closed, using the javax.sql.ConnectionEvent Listener > interface. I think that most major Database vendors support this ?? but > ralph is right, there is no standard way to be notified when a connection is > opened. I suppose you should consider writing or using some kind of > connection pool object which manages all the Connections across your > applications. This is a widely used techinque and theres plenty > documentaion out there about connection pools. You at least need to create > a class that sits between your application and the standard JDBC way of > getting a connection, so that you could generate the events you want or keep > a count of open connections. i.e. this would involve changing all your > servlets/jsps, to get connections the new way, > > > > Steve. > > -----Original Message----- > From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]] > Sent: 05 June 2002 15:47 > To: Tomcat Users List > Subject: AW: jdbc connection list > > > For connection you are out of luck. > > There is nothing like a common event model for > connections or connection pools. (No driver > or pool that I know has a feature like this). > > One solution if you have complete control over > any class that accesses the database: > > Wrap the pool or the connection inside a own class > that delegates all get/release calls to the underlying > class and track the connection count. > > If you have third party tools that access the database > I think that you have lost with the most databases. > With some database it's possible to get a list of > open connection through system views or stored procedures. > (E.g. Oracle) but that's not portable. > > > -----Urspr�ngliche Nachricht----- > > Von: Darya Chernikhova [mailto:[EMAIL PROTECTED]] > > Gesendet: Mittwoch, 5. Juni 2002 16:34 > > An: Tomcat Users List > > Betreff: Re: jdbc connection list > <snip/> > > I'd like to write a bean that would keep track of all > > of the jdbc connections that users make. > <snip/> > > -- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
