cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Coboos <cromo...@gmx.net>
Subject Re: AW: How to initialize a component coming from the pool?
Date Wed, 11 Feb 2004 20:27:09 GMT
Olivier Billard wrote:

> Hi Stefan,
>
> 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.


OK, I will try it.

Thank you.

Stephan

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


Mime
View raw message