Max Ischenko wrote:
> Aaron Held wrote:
>> I usually create a dbpool and get /return a connection just when it
>> is needed.  The connections always exist, but they are shared between
>> servlets.
> 
> 
>> Lately I have been thinking that I should just create a new db
>> connection in the __init__ and check it in awake, since pretty much
>> every servlet uses the database.
> 
> But this is dangerous because then db coon can be shared across
> threads (servlets are shared, right?).

Nope.  Servlet instances are taken from a pool and a servlet instance can
only be in use by a single thread at a time.  Additional servlet instances
are created as needed.

(There are rarely-used flags that can change this behavior but what I
described is the default.)

- Geoff


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to