commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: DBCP woes (running out of cursors).
Date Sun, 18 Oct 2009 21:04:59 GMT

Thanks Phil-

there is some undocumented behaviour noticed with the (presumably DBCP) cursors
i suspect the poster is allocating n number of (presumably updateable) cursors and then not
using them 
the connection starves becuase the inactivity period is reached and consequently the cursors
are released (as the statement handle is released)
then the poster attempts to reuse the cursor (presumably for update)

for this to be *solved* we're going to need a complete matrix of 
inactivity_period=1sec

step1
allocate 1 read cursor per connection and test
allocate 2 read cursors per connection and test
allocate n read cursors per connection and test

next 
alloocate 1 updateable cursor per connection and test
allocate 2 updateable currsors per connection and test
allocate n updateable cursors per connection and test

next 
allocate 1 read cursor and 1 updateable cursor per connection and test
allocate 2 read cursors and 2 updateable cursors per connection and test

increment inactivity_period by 1sec
goto step1

i can test this out with mysql or oracle here
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten
wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist
unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet
keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire
prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe
quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information
seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune
responsabilité pour le contenu fourni.




> Date: Sun, 18 Oct 2009 13:10:45 -0400
> From: phil.steitz@gmail.com
> To: user@commons.apache.org
> Subject: Re: DBCP woes (running out of cursors).
> 
> Bill Davidson wrote:
> > Bill Davidson wrote:
> >>Could maxOpenPreparedStatements possibly fix this?
> > 
> > Apparently it does.
> > 
> > The DBCP config docs need a better warning on poolPreparedStatements:
> > 
> > "*NOTE* - Make sure your connection has some resources left for the
> > other statements."
> > 
> > just doesn't quite cut it.  Something more like:
> > 
> > "Pooling PreparedStatement's may keep their cursors open in the database,
> > causing you to run out of cursors.  You should also set
> > maxOpenPreparedStatements to some value less than the maximum number
> > of cursors you can have on a Connection."
> > 
> > or something along those lines.
> 
> Sorry for the slow response.  Sounds like you have solved your
> problem.  I assume you are now getting SQLExceptions when you go
> past the maxOpenPreparedStatements limit. If not, there must be
> something else going on.
> 
> Thanks for the documentation feedback.  Fixed in trunk.
> 
> This example makes me think that better behavior here would be for
> the prepared statement pool to act as an LRU cache (rather than
> throwing SQLException when maxOpenPreparedStatements is exceeded).
> Interested in other opinions on this.
> 
> Phil
> 
> 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message