Re: About connection pooling
- From: "Robert Klemme" <bob.news@xxxxxxx>
- Date: Fri, 16 Dec 2005 14:38:08 +0100
Juha Laiho wrote:
> Mika Myllyvirta <mika.REMOVEmyllyvirtaTHE@xxxxxxxxxxxxxxxx> said:
>> Could somebody explain the connection pooling for me a bit more? Or
>> to
>> be specific, how do I obtain the correct connection pooling for my
>> servlet.
>
>> I have been aware of connection pooling and the benefits of pooled
>> connections. Every time I read about this subject I get a different
>> answer(!). So here is what I have found out: (the question mark
>> stands
>> for your correction if I am wrong :)
>>
>> 1. jTDS (and jdbc) has a builtin connection pooling (?)
>
> jdbc doesn't define connection pooling;
http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/PooledConnection.html
> jTDS could still very well
> have
> an implementation of connection pooling included.
http://jtds.sourceforge.net/faq.html
>> 2. Apache Tomcat has a builtin connection pooling (?)
>
> Yes. See f.ex.
>
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
>
>> 3. and there are other classes that I can use to make my servlet to
>> pool connections (eg. DBPool, DBCP, JNDI (?))?
>
> Not JNDI (it's again a specification, with multiple implementations),
> but DBCP and DBPool are packages providing connection pooling
> implementation. Actually DBCP is what is used by Tomcat, if I'm not
> grossly mistaken.
>
>> Which of these pools should I use?
>
> Either jTDS pooling or Tomcat pooling. The former in case it provides
> some
> functionality Tomcat (DBCP) pooling doesn't provide, and that
> functionality
> is important to you. If this is the case, I recommend to write enough
> code to be able to configure the jTDS pool through Tomcat (as the
> default
> Tomcat pool is configured), and thus keep the changes outside your
> servlet
> code. I've done this to be able to use Oracle pooling implementation
> in
> Tomcat, and it wasn't too hard.
>
> If you need to have something fast (or "just yesterday"), then go
> ahead
> with Tomcat pooling - and migrate to jTDS pooling later on -
> remembering
> that your application code will not see the difference.
I don't see any jTDS connection pooling on the horizon so I'd stick with
the most general in this case, Tomcat pooling. It comes with the servlet
container and needs no additional packages.
Kind regards
robert
.
- References:
- About connection pooling
- From: Mika Myllyvirta
- Re: About connection pooling
- From: Juha Laiho
- About connection pooling
- Prev by Date: Re: J2EE: Storing hierarchical data
- Next by Date: Re: J2EE: Storing hierarchical data
- Previous by thread: Re: About connection pooling
- Next by thread: IBM JDBC help!
- Index(es):
Relevant Pages
|
|