cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Coboos <cromo...@gmx.net>
Subject Re: Correct use of databases in XSP
Date Fri, 01 Oct 2004 05:37:09 GMT
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


Mime
View raw message