tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Behrens" <...@diekleinedomain.de>
Subject RE: DB Connection
Date Tue, 27 May 2003 10:07:31 GMT
Thanks for the help. It looks like I have to redesign my db layer :( It would
be really helpfull to have someone comment on what I have done so far and am
planing to do now. So far I used a specific class to build a "where-clause",
connect to the db, execute my query and store the ResultSet within the
instance of that class. The "common" ResultSet would be READ_ONLY and I used
the data within it after the connection has been closed. I understand from
earlier replies that closing the Connection without closing the ResultSet
doesn't work in terms of connection pooling either.
This leads me to the conclusion, that I have to copy the extracted data into
an Array for further processing. Is that a reasonable approach or is there a
better practice?

Again, any help & comments would be very much appreciated!

Jan

> -----Original Message-----
> From: Ralph Einfeldt [mailto:ralph.einfeldt@uptime-isc.de]
> Sent: Tuesday, May 27, 2003 8:08 AM
> To: Tomcat Users List
> Subject: RE: DB Connection
>
>
> There are some advantages in using a connection pool:
>
> - With several databases it takes some time to connect to a
>   database (mysql is quite fast in this respect)
> - You can limit the number of concurrent connections without
>   limiting the number of concurrent users in the same way.
>   (Request for a connection are queued, so instead of simply
>   getting an error the user has just to wait a little bit
>   longer for his data)
> - Some pools provide means to identify or handle a connection
>   leak
> - You can get well defined error messages if the pool can't get
>   a connection within a configured timeslot.
>
> For your last question:
>
> I don't like the idea of automatically closing abandoned
> connections. I prefer to get clear warnings or errors
> if this happens, as this enforced the elimination of the
> cause and not just to cure the symptoms.
>
> > -----Original Message-----
> > From: Jan Behrens [mailto:jan@diekleinedomain.de]
> > Sent: Monday, May 26, 2003 11:19 PM
> > To: Tomcat Users List
> > Subject: RE: DB Connection
> >
> > I understand that, in using a  connection pool i can get
> > Tomcat to handle the number of connections at any given
> > time. Is that correct? If I still have to ensure that all
> > ResultSet's and connections have to be closed, then where
> > is the advantage? And, would it be a good idea to
> > automatically close abandoned connections after a certain
> > amount of time?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message