Hi Erik,

this is what i really do,
i believe that closing the connection will close automaticly the statement and the 
resultset, or?
the point is, i work with the resultset in a function, which is hidden from the db 
access,
so there i only have my resultset. From these i try to get the statement and from the 
statement i try to
get the connection. If there are all of these 3 not null i close the connection.
Yes i know it looks a bit strange, but depending on the javadoc these should do the 
same.

// this checks if the rset is available and if the statement is available and if the 
connection is available
if (rset!= null && rset.getStatement() != null && rset.getStatement().getConnection() 
!= null) { 
            rset.getStatement().getConnection().close();
}

Never the less this seems to work, but sometimes i got an exception saying that my 
pool is exhausted... 
and this is what i do not understand. i checked if this connection i borrow and the 
connection i close
are the same and yes they are... so hey what is the problem? Can it be that i borrow 
my connections
to fast from the pool?
Sometimes 3 till 10 per second, but they are released immediately.

Any ideas how to avoid this exception

org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted    
 at 
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)  
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)     
 at de.orb.quick.model.CommunicationLayer.executeStatement(CommunicationLayer.java:86) 
  at de.orb.quick.model.SystemDataBean.getResult(SystemDataBean.java:43)  at 
_renderSystem._jspService(renderSystem.jsp:8)                   ....

have a nice day

mirko




Mit freundlichen Grüßen

Mirko Wolf

-----------------------------------------------------------------------------------------------------------------------------------------
panta rhei systems gmbh
budapester straße 31
10787 berlin
tel +49.30.26 01-14 17
fax +49.30.26 01-414 13
[EMAIL PROTECTED] 
www.panta-rhei.de 

Diese Nachricht ist vertraulich und ausschliesslich für den Adressaten bestimmt. Jeder 
Gebrauch durch Dritte ist verboten. Falls Sie die Daten irrtuemlich erhalten haben, 
nehmen Sie bitte Kontakt mit dem Absender auf und loeschen Sie die Daten auf jedem 
Computer und Datentraeger. Der Absender ist nicht verantwortlich für die 
ordnungsgemaesse, vollstaendige oder verzoegerungsfreie Übertragung dieser Nachricht.

This message is confidential and intended solely for the use by the addressee. Any use 
of this message by a third party is prohibited. If you received this message in error, 
please contact the sender and delete the data from any computer and data carrier. The 
sender is neither liable for the proper and complete transmission of the information 
in the message nor for any delay in its receipt.


>>> [EMAIL PROTECTED] 08/24 4:34  >>>
Why not just close the connection if con != null && !con.isClosed() ?

I always:
try {
    if (rs != null) rs.close();
}
catch {}

try {
    if (ps != null) ps.close();
}
catch ()

try {
    if (c != null && !c.isClosed()) c.close();
}
catch {}

Not sure if that is it, but I don't understand your logic for deciding 
whether to close the connection. I am using Oracle with DBCP. I have a 
couple of properties set differently from you, but I don't see any that 
would be the problem.

Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to