----- Original Message -----
From: Steven J. Owens <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 14, 1999 8:50 PM
Subject: Re: A doubt on scalability....
> pradeep asks:
> > I am modifying a site to which the number hits per month is very
> > high.earlier it was implemented with CGI scripts and now I am changing
it to
> > 3-tier web application with Servlets on web server.
> >
> > When evaluated the pros and cons I am strucked up with the question of
> > solving the scalability problem.I can not keep on generating connections
to
> > the database in response to the client request to query the database
>
> Aside from any servlet engine facilities for pooling database
> connections, why not just instantiate a database connection as an
> instance variable in the servlet, and keep it open?
Because the same instance of the servlet is used by multiple threads
simultaneously. You will definately get wierd results if you try that.
> Or, if each request takes a while to complete, code a database
> connection pool object - it would keep a vector of connection objects,
> and let each servlet invocation check a connection out when it starts
> and check it back in when it's done.
This is actually the best tactic. Since creating connections can take
seconds each, it makes sense to create them up front and reuse them as
necessary.
>
> Steven J. Owens
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
___________________________________________________________________________
> 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
>
___________________________________________________________________________
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