I'll get a fresh connection at each public call. The problem wes that I got some public methods also called by other public methods. Now I must test the existence of an existing connection before doing stuff.
Anyway, thanks again!
-- Olivier
On 08/10/2003 17:35, Unico Hommes wrote:
If you would hold on to a connection for the lifetime of the ThreadSafe component (and in the case of ECM that means from startup to shutdown of the container itself) it means that that particular connection will not be available to other components to reuse (DataSourceComponent pools its connections). To avoid this you should get a fresh connection from the pool whenever you need one.
Regards, Unico
-----Original Message----- From: Olivier Billard [mailto:[EMAIL PROTECTED] Sent: woensdag 8 oktober 2003 11:59 To: [EMAIL PROTECTED] Subject: Use of a connection in an avalon component
Hi all !
I wonder how to use a DataSourceComponent and its connection in a custom avalon component, that is ThreadSafe, to use all performance and connection pool used in Cocoon.
Should I :
- get and close() a connection via datasource.getConnection() for each public method call,
- get a connection in the initialize() method from the interface Initializable, close() it on the dispose() method from Disposable interface, and only create a Statement for each public method call ?
- implement another avalon interface, like Runnable, to get/relase the Connection ?
Thank you,
-- Olivier BILLARD
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
