Martijn Faassen wrote:
On Tue, Jun 17, 2008 at 2:30 PM, Brian Sutherland
<[EMAIL PROTECTED]> wrote:
Just commenting that IDatabase.engine is not used by any code external
to the Database object. There's no use case for it to be public.
While I am not sure we have a strong use case for engine anyway, I
like methods that people can implement to affect behavior (especially
when subclassing) to be public. I don't feel comfortable implementing
something that starts with an underscore.
Why not just have:
"""A utility that specifies the database.
"""Create a new session
"""Get unique id for this database configuration.
This should be unique per site (application).
engine = create_engine(
# we use the application name as the unique id. Can we use
# something more clever and universally working?
As Laurence has suggested, the session persists, so
IDatabase.configuration will only be called once per thread. Not sure if
creating one new engine per thread is bad.
I don't know either. I've assumed that one wouldn't want to recreate the
engine for each thread, but perhaps that's fine and we don't break any,
say, connection pooling mechanisms that way? I do not know.
Unfortunately I don't either...
I'm not sure connection pooling is really useful in a threaded
environment with recycled sessions. You want n threads = n connections.
If we started creating new sessions each request then things would be
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -