Re: Finding Broker/Connection leak
Armin Waibel <[email protected]>
| Newsgroups | gmane.comp.jakarta.ojb.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Tino, Tino Schöllhorn wrote: > Hi, > > I have a situation where we are running out of PersistenceBrokers (using > 1.0.1). We have a web application which so far runs fine - but somehow > some requests are causing the application not to close its PB. > > We can see this when we are monitoring the used connections of mysql > which are slowly growing - even if we are using ConnectionPooling. These > connection are on the state SLEEP for quite a long time and seem never > to be closed. > > At some point the application runs out of PB (we are using size 100 of > the PB-Pool). > > So it seems (quite obviously) that some PBs are not cleanly handled. > > Do you have any advice for us finding those leaks? > In current versions there is no PB leak detection. Such a feature will be part of the next version (or try latest from SVN OJB_1_0_RELEASE branch). It would be possible to modify your 1.0.1 version to support broker leak detection. Have a look in latest PBImpl (OJB_1_0_RELEASE branch) and port the detection part in method PBimpl#setClosed and PBImpl#finalize to your class. http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java?revision=398752&view=markup > Does it do any good when we "tune" mysql that it discards connections > which are quite old (via property "max_timeout")? Is OJB discaring those > PBs whose connections have died ? If you correctly use the PB instances (lookup PB instance when needed, close it after use) the connection pool should handle connections in a correct way. But if you don't close PB instances after a query, the connection will still be associated with the PB instance, please see http://www.mail-archive.com/ojb-user%40db.apache.org/msg15389.html regards, Armin > > I am glad for any suggestions. > > Tino > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >