Howdy,

>That being the case.  If you open a database connection in the init
method
>of a servlet, will that connection be the only one for all threads?

Yup, which is why opening a connection in the init method is not a good
idea for scalability.  Instead, use a connection pool (possibly defined
in server.xml), and obtain and release connections in your service
methods.

Yoav Shapira


>
>-Peter
>
>At 09:42 AM 11/10/2003, you wrote:
>>Think of the servlet as a multithreaded object.
>>It spawns a new thread for each request.
>>
>>
>>On Monday 10 November 2003 09:23 am, Peter Guyatt wrote:
>> > Hi All,
>> >
>> >       I am hoping someone can help answer me this quick question.
>> >
>> > If I had a web app with one servlet for processing all requests
would
>that
>> > one servlet be used by every thread or is it a one to one relation
>(each
>> > thread uses its own instance of the servlet).
>> >
>> > Thanks
>> >
>> > Pete
>> >
>> >
>> >
---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail:
[EMAIL PROTECTED]
>>
>>--
>>Ben Souther
>>F.W. Davison & Company, Inc.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to