Laurence Rowe wrote:
Martijn Faassen wrote:
Hey Laurence,
Laurence Rowe wrote:
[snip]
We'll have to stick with scoped sesssions because of threading, but
the engine as local utility pattern should still work.
#myapplication/__init__.py
Session =
scoped_session(sessionmaker(bind=LookupEngine('my-engine')...))
engine = EngineUtility(url='sqlite:///')
provideUtility(engine, IConnectable, 'my-engine') # but normally a
local utility registration
#myapplication/foo.py
from myapplication import Session
session = Session()
Would session = ISession(context) be a reasonable way for grok to handle
this?
Making transactions span multiple instances of a single app seems
impossible otherwise, though maybe that is an edge case that need not be
supported.
Laurence
_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )