cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject RE: Use of a connection in an avalon component
Date Wed, 08 Oct 2003 15:35:48 GMT

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:obillard@rennes.jouve.fr]
> Sent: woensdag 8 oktober 2003 11:59
> To: users@cocoon.apache.org
> 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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message