cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mariusz Sieraczkiewicz <marte...@stud.ics.p.lodz.pl>
Subject Database connection from flowscript
Date Thu, 27 Nov 2003 21:27:27 GMT
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