I had the same pb, and I solved it the way Marco wrote, that is to say :
private field : - private Connection connection;
initialize (called once in the lifetime) : - get the datasource
dispose (called once in the lifetime); - release the datasource
recycle (called each time your component returns to the pool) : - close the connection and set it to null;
private getConnection() {
if (connection==null)
connection = datasource.getConnection();
return connection;
}and each time you need a connection, use getConnection() to get it.
For me, it works good. HTH -- Olivier Billard
On 10/02/2004 13:47, Stephan Coboos wrote:
Marco Rolappe wrote:
and why isn't that possible? AFAIK implementing Poolable doesn't preventHello Marco,
implementing Disposable. if you implement Disposable, the component's
dispose() method should get called when the pool and therefore the
pooled/recycled component itself gets disposed.
yes, you're right. But I mean that Disposable for me has no affect because I'am already using Recyclable and Dispose will only be called if the component will be destoyed.
Best Regards Stephan
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
