You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2004/10/01 07:37:09 UTC
Re: Correct use of databases in XSP
Maybe you should return the dbselector by releasing it after the work:
manager.release(dbselector);
And connection.close() should return the connection correctly into the
pool. I'm not shure where I had read this but it is documented somewhere
that this wrapps the java connection and returns the connection
correctly into the pool.
Regards
Stephan
Christoph Kliemt wrote:
>Hi!
>
> i am not sure if this is correct:
>
> In an xsp-page:
>
> <xsp:logic>
>
>[...]
>
> ComponentSelector dbselector =
> (ComponentSelector) manager.lookup(DataSourceComponent.ROLE + "Selector");
> datasource = (DataSourceComponent) dbselector.select("some_db");
>
> Connection connection = datasource.getConnection();
>
> Statement statement = connection.createStatement();
>
> ResultSet rs = statement.executeQuery( some sql);
>
>[...]
>
> connection.close();
>
> </xsp:logic>
>
>If i dont close the connection cocoon hangs and waits for the pool. So
>there has to be a way to put the connction back into the pool. Is this
>done by closing the connection?
>
>Where in the docs do i find this information?
>
>cocoon version is 2.1.5.1
>
>cu
>
>christoph
>
>---------------------------------------------------------------------
>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