Subject RE: [Firebird-Java] Re: memory leaks?
Author Hagerty, Tim
Not sure if it will help but were using Interclient and we establish a connection and carry a reference to that connection in a session object per user connected. This eliminates the use to establish and open a new connection object on every method.
 
I'm thinking that somewhere along the way some one is coding methods with individual connections and not closing them correctly.
 
Tim
-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Monday, September 23, 2002 3:53 AM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Re: memory leaks?

Hi,

I'm not sure if this can be a problem, but why do you use InterClient
specific classes to open and close connections? Usually people use
java.sql.DriverManager to open connection and connection.close() to
close the connection.

If this does not help, try our type 4 JCA-JDBC driver (JayBird), it's
available from SourceForge. If you want to keep using InterClient, you
should try InterClient 2.5 from Borland (it is shipped with InterBase
6.5, not free). Firebird team does not develop InterClient, and
version 2.01 is the last version of this software available from
Firebird project.

Best regards,
Roman Rokytskyy

--- In Firebird-Java@y..., "alesjelovsek" <software@c...> wrote:
> > Hello!
> >
> > We have experiance some problems using InterClient. IT seems like
> > connections to
> > database are not closed or at least some of them are not closed so
> computer
> > runs out
> > of memory because of that.
> > We are using Tomcat Version 4.0.4.
> > Attached see java code for creating and closing connection.
> >
> > Here are some other code snippets:
> >
> >             DBConnection connection = new DBConnection();
> >             Connection con = connection.getConnection();
> >             String strQuery = "SELECT * FROM
> P_GetPostajalisceNaziv("+strPostajalisceID+")";
> >
> >             PreparedStatement pst = con.prepareStatement(strQuery);
> >             ResultSet rs = pst.executeQuery();
> >             if (rs.next()) {
> >                 postajalisce  = rs.getString("oNazivDelovni");
> >             }
> >
> >             rs.close();
> >             pst.close();
> >
> >             if (connection != null) connection.freeConnection();
> >
> > I hope someone can give us some poitners what could be wrong with
> our code
> > or some other solution.
> >
> > TIA and best regards,
> >
> > Matjaz



To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.