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.

Wow. That's very good news.


So, I can be sure that any servlet's instance variable won't be accessed
by multiple threads, right?

In contrary to session's data, which can be accessed by several threads
sometimes (as Ian told).




------------------------------------------------------- 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