Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 18210 invoked from network); 2 Sep 2003 14:20:42 -0000 Received: from unknown (HELO socketware.com) (209.195.1.83) by daedalus.apache.org with SMTP; 2 Sep 2003 14:20:42 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [DBCP] Problem: Connection closes prematurely Date: Tue, 2 Sep 2003 09:58:21 -0400 Message-ID: <8BB65B8A64970A44B5AAA23988DC4CD62DE5EF@angel.headquarters.socketware.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [DBCP] Problem: Connection closes prematurely Thread-Index: AcNvs2qNSpiQLyTYSs6kN9ic8FM49QBpdbRw From: "Vivian Fonger" To: "Jakarta Commons Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi everyone, I cannot find the configuration setting - "removeAbandoned" or "removeAbandonedTimeout". I have configured the following parameters in GenericObjectPool: setWhenExhaustedAction setMaxActive setMaxIdle setTestOnBorrow setTestOnReturn setTestWhileIdle setTimeBetweenEvictionRunsMillis setMinEvictableIdleTimeMillis setMaxWait I cannot find anything regarding removeAbandoned or removedAbandonedTimeout. My application is using commons-pool version 1.1 distributed at 2002/05/04. This is the error the application trapped when the application is trying to traverse the next record in the ResultSet: java.sql.SQLException: Connection is closed. at org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnect ion.java:251) at org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingC onnection.java:176) at com.accucast3.transaction.TransactionManager.updateTrialTable(Transactio nManager.java:517) at com.accucast3.transaction.TransactionManager.run(TransactionManager.java :389) at java.util.TimerThread.mainLoop(Timer.java:430) at java.util.TimerThread.run(Timer.java:380) If anyone can give me some pointers on this problem, I will really appreciate it. Thanks Vivian Fonger Vivian Fonger Software Engineer Socketware vfonger@socketware.com -----Original Message----- From: Dirk Verbeeck [mailto:dirk.verbeeck@pandora.be]=20 Sent: Sunday, August 31, 2003 7:31 AM To: Jakarta Commons Users List Subject: Re: [DBCP] Problem: Connection closes prematurely A connection is considered active when it is borrowed from the pool by=20 getConnection(). The connections in the pool are idle. maxIdle & maxActive are both caps on the number of objects idle / active. If you try to return a connection to the pool (by calling close()) and=20 the maxIdle limit is reached then the connection will be destroyed and=20 not be added to the pool. If you have enabled "removeAbandoned" then it is possible that a=20 connection is reclaimed by the pool because it is considered to be=20 abandoned. This mechanism is triggered when (getNumIdle() < 2) && (getNumActive() > getMaxActive() - 3) For example maxActive=3D20 and 18 active connections and 1 idle = connection would trigger the "removeAbandoned". But only the active connections that aren't used for more then=20 "removeAbandonedTimeout" seconds are removed, default (300 sec). Traversing a resultset doesn't count as being used. If your traversal takes more then 300 sec then you can either disable=20 the "removeAbandoned" or increase the "removeAbandonedTimeout". But you are probably doing some processing while traversing the resultset. If it takes so much time, then it's better to copy the resultset data=20 first into an array, close the connection and then do the processing. If you need more help, please include version numbers, full=20 configuration parameters and maybe a stacktrace. Hope this helps Dirk Vivian Fonger wrote: >Hi everyone, >=20 >I want to know what connection is considered active and what connection >is considered idle. Currently, my application is using DBCP connection >pooling and I am having problem with connection closes premarturely.=20 >This happen when the application is trying to traverse a resultset and=20 >the application is extremely busy (i.e. a lot of threads are requesting >database connectivities to perform database actions). I have set the=20 >maximum number idle connections pretty low, I am just wondering will=20 >that be a cause of database connection closing prematurely when the=20 >application is still traversing a resultset. >=20 >Vivian Fonger >=20 >=20 > > =20 > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org