Dmitry Maximovich wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
>
> I'm just wondering, why do you need a connection "pool"?
> Probably it's enough to create one connection in method init() of servlet
> and then you could just create statements from one connection   Statement stmt = 
>conn.createStatement();
> and use it. As far as I know there is no interference between few threads or 
>something like that,
> you could create as many Statements from one Connection object as you want and use 
>it together in
> same time. Or I'm not right?
>

Some JDBC drivers (not the good ones :-) have problems with multithreaded access -- 
but that is not the
most serious potential problem.

One of the places you will definitely get interference is on transactions.  For most 
databases, all of the
activities that occur on a particular connection will be considered part of the same 
transaction, so a
COMMIT or ROLLBACk from one thread will cause problems for transactions in progress on 
other threads --
even though the JDBC driver might be thread safe with respect to multiple statements 
being executed on the
same connection simultaneously.

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to