Create a Database connection, in the constructor of the servelt. Since it is a
servlet, when the servlet is first initialized, the constructor is called and
the DB connection is created. Then do not close the connection at the end of
the servlet execution. The servelt stays in memory which is one of its main
reasons for its speed. There is no over head for loading into memory every time
there is a request. After the initial request and the servlet is loaded, and
the DBconnection created. The connection will remain open as long as the
servlet is in memory.
A word of caution. During testing, be sure to close the conneciton. If the
servlet is repeatedly reloaded into memory, and creating a new connection, the
Oracle server will become laden with previous/useless connections. However,
once in production, this will increase your performance, because of the overhead
in creating a new DB connection each time.
DanC
Jarec Basham wrote:
> Hi all,
>
> I've just inherited a servlet based system that makes a great use of an
> Oracle database. To be more precise every servlet inherits a base servlet
> which opens a database connection at the start of the servlets run and
> closes it when the run finished. This looks to me like a real system killer
> as load increases and I am currently looking at solutions to implement
> connection pooling.
>
> What I need to try to find out in the short term is how many connections
> Oracle can handle before it chokes on the load and what sort of magnitude of
> performance degradation we are likely to see as we approach this figure. If
> anyone has any experience of this kind of issue any input would be greatly
> appreciated.
>
> Thanks in advance
>
> Jarec
>
> ___________________________________________________________________________
> 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