Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news7 From: Wojtek Newsgroups: comp.lang.java.programmer Subject: Re: The easiest framework for Java Database applications development released for production use Date: Tue, 08 Feb 2011 21:59:55 -0800 Organization: NewsGuy - Unlimited Usenet $19.95 Lines: 33 Message-ID: References: <740c95bd-a21f-4ad3-8733-6b3b61e44e18@l18g2000yqm.googlegroups.com> <92e64642-b624-4598-beaa-c57540a30733@k22g2000yqh.googlegroups.com> <4d51da6f$0$23756$14726298@news.sunsite.dk> NNTP-Posting-Host: pc873abd50669a6d41c4bfe0a6ef3579587b7c0651bbb1855.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit X-Newsreader: MesNews/1.08.03.00-gb Xref: csiph.com comp.lang.java.programmer:26221 Arne Vajhøj wrote : > On 07-02-2011 23:51, Wojtek wrote: >> yaormaAdmin wrote : >>> Often in large projects someone, somewhere, inevitably forgets to >>> close the Statement and/or the Resultset in a finally block where an >>> exception is thrown. This results in a cursor being left open in the >>> database. Eventually the code is executed enough times to exhaust the >>> maximum number of cursors allowed for the connection. The next call >>> that opens a cursor in the database fails. This is often not the >>> offending code but some perfectly good code that exists in some other >>> far off place in the code. >> >> Or you could just use a connection pool manager such as proxool. Use >> proxool to log into the database and then it manages all of that. DB >> connections which are idle for a given number of milliseconds are >> automatically closed. So all of the extra coding to fit yet another >> framework is not needed >> >> Plus you get far better DB performance under load as you do not need the >> expensive connection establishment for every DB operation. > > It is good advice to use a connection pool. > > But if you don't close the connections then they > are not returned to the pool and the pool will run > out of connections very quickly. proxool auto-closes idle connections -- Wojtek :-)