Re: MysqlConnectionPoolDataSource leaving dangling connections
Posted by: Mark Matthews
Date: April 05, 2005 02:52PM

Sudhir Movva wrote:
[snip]
> Can any one give me any pointers as to why this is
> happening? or can point my mistake?
> Thanks,
> -Sudhir.

Sudhir,

1) Unless you're an application server vendor (or you are installing Connector/J into an application server that wants to use ConnectionPoolDataSources such as IBM Websphere), you shouldn't be using MysqlConnectionPoolDataSource 2) In any case, the physical connection does not go away until you call PooledConnection.close(), calling conn.close() only closes the 'logical' connection, which requires that any listeners on the ConnectionPoolDataSource be called so that it can _reclaim_ but not close the physical connection so that it can be handed out again, and 3) You're using very old versions of both Connector/J and MySQL and might want to consider upgrading (Connector/J is at 3.0.16 and the last release of MySQL 4.0 is at 4.0.24 currently, although the 'current' stable release is 4.1.10).

ConnectionPoolDataSources are _not_ connection pools! They are 'vendors' of connections to connection pooling code. If you don't have your own connection pooling code, then you definitely don't want to be going this route!

If you need a standalone connection pool, I recommend c3p0 (http://c3p0.sf.net/)

Regards,

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: MysqlConnectionPoolDataSource leaving dangling connections
April 05, 2005 02:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.