cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Stöckel <Matthias.Stoec...@fztig938.bank.dresdner.net>
Subject Re: Database connection from flowscript
Date Fri, 28 Nov 2003 12:32:10 GMT
Hi Mariusz,

we encountered the same problem. Our case was a little bit different, 
but the results were definitely the same (>1500 open connection on the DB).
I think the problem is that the connection will only being returned to 
the pool, as soon as the continuation object gets destroyed, and that 
can take some time depending on your configuration. I haven't looked 
into the code yet, so this is only an assumption.
Perhaps one of the commiters can jump in here and help a little bit. If 
I have the following flow code, I would assume that the 'schandler' 
object is not any longer referenced and can be finalized as soon as I 
set it to 'null'. Unfortunately this will not happen.
Is this a bug, or is there something wrong with the code?
Cheers,
   Matthias

var schandler=new 
Packages.xyz.ClientHandler(getSelectedClients(),connection);
...
schandler=null;


Mariusz Sieraczkiewicz wrote:
> I asked the question about getting jdbc connection from flowscript on 
> user mailing list
> some time ago, but there was no answer. I started digging, but had some
> problems.
> I'm having code like this:
> //////////////////////
>     var dbSelector = 
> cocoon.getComponent(Packages.org.apache.avalon.excalibur.datasource.DataSourceComponent.ROLE

> + "Selector");
>     try {
>         var dataSrc = dbSelector.select(srcName);
>         conn = dataSrc.getConnection();
>     }
>     catch (e) {
>         e.printStackTrace();
>     }
>     finally {
>         if (conn != null) {
>             conn.close();
>             conn = null;
>         }
>         if (dbSelector != null) {
>             cocoon.releaseComponent(dbSelector);
>             dbSelector = null;
>         }
>     }
> ///////////////
> 
> Using it I'm experiencing pooled connection out of resources
> after several calls (page using it just hungs).
> I'm afraid I'm not realeasing all resources properly. What's wrong?
> 


Mime
View raw message