Hello all,

Just like to say first of all how much I love Webware.


Well personal confessions out of the way, I'd like to
ask if anyone can help me get how to use DBPool.

I noticed an earlier post (
http://sourceforge.net/mailarchive/forum.php?thread_id=2054471&forum_id=3505
), but I have to admit I didn't really get the
solution. 

Where should you instantiate a DBPool? Can you
initialise one for the use of all servlets in your
application?

For example let's say I'm using WebKit, have a
SitePage that all my Webware servlets inherit from and
I have created a number of servlets based on the
SitePage e.g. Login.py , Main.py, AddItem.py etc. that
all need to interact with a given database. I gather
that I could just get my SitePage base class (or even
the derived servlets if not all of them need database
access) to just open and hold a connection which
persists as long as the servlet does. So in the
example above my application would have an open
connection for each of the above three servlets. 

Now what if instead of the base or derived servlets
opening a database connection, I wanted to create a
pool of connections and then any of the servlets could
grab a connection from the pool, use it and release
when done. Where would I create the pool, and how
would each servlet communicate with it? Do you create
one in the __init__.py file for the package context? 

I think I'm exposing some deep conceptual confusion
about the use of a DBPool in Webware. However I think
that in some sense (probably incorrectly) I'm
expecting it work like pooled database connections in
AOLServer. That is, the pool exists within the
execution environment of the webserver and so any
"script" executing in that environment can make a call
to the webserver's API that returns a connection to
the database, which can be released when done with.

Can something similar be done in Webware using the
DBPool?

Thanks
Adam Shimali

__________________________________________________
Yahoo! Plus - For a better Internet experience
http://uk.promotions.yahoo.com/yplus/yoffer.html


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to