Make sure that you ALWAS close your connection in the 'finally' clause!!!
Ex:
void foo()
{
Connection cnn = null;
try
{
// USE THE CONNECTION HERE
DataSouce ds = ( DataSource )new InitialCotnext().lookup( ... );
cnn = ds.getConnection()
// etc...
}
catch( ... )
{
// handle execptions
}
finally
{
// CLOSE THE CONNECTION HERE
if ( cnn != null )
{
try{ cnn.close(); } catch( Exception e ) {}
}
}
}
-----Original Message-----
From: Martin Cabrera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 12:55 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] DB2 Pool don't reuse open connections
Hi;
I have a DB2 pool defined in my jboss.jcml file. Every time I use the pool
from my ejbs jboss opens a new connection and don�t reuse the actual
connections. When jboss reachs the max size of the pool it hangs.
Any ideas?
I append the pool definition at the end of this mail.
Thanks in advance.
Mart�n Cabrera
IT Manager
Proyecto Abitab OnLine
Abitab S.A.
Montevideo - Uruguay
[EMAIL PROTECTED]
<mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=DB2JdbcProvider">
<attribute name="Drivers">COM.ibm.db2.jdbc.app.DB2Driver</attribute>
</mbean>
<mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=DB2">
<attribute
name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attr
ibute>
<attribute name="PoolName">ONLINE</attribute>
<attribute name="URL">jdbc:db2:OLDESA</attribute>
<attribute name="JDBCUser">wldesa</attribute>
<attribute name="Password">wldesa</attribute>
<attribute name="MaxSize">10</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">true</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
