[Zope3-Users] z3c.zalchemy - which version to use?
Darryl Cousins
darryl at darrylcousins.net.nz
Fri May 9 00:07:00 EDT 2008
Hi Hermann,
Perhaps you've missed this discussion on zope-dev beginning:
http://mail.zope.org/pipermail/zope-dev/2008-May/031753.html
HTH,
Darryl
On Thu, 2008-05-08 at 09:24 +0200, Hermann Himmelbauer wrote:
> Am Mittwoch, 7. Mai 2008 17:43 schrieb Christian Theune:
> > On Wed, May 07, 2008 at 03:41:11PM +0200, Hermann Himmelbauer wrote:
> > > Hi,
> > > I'd like to know if / which SVN version/branch of z3c.zalchemy works with
> > > a current SQLAlchemy distribution.
> > >
> > > If none does, what about z3c.sqlalchemy?
> >
> > In addition to what Andreas said: zalchemy is going to be abandoned.
> > zope.sqlalchemy will be the common base implementation of transaction
> > integration with SQLAlchemy. Other packages like z3c.sqlalchemy will
> > implement higher level functions in addition to that.
>
> Ah, interesting, I was not aware of the existence of zope.sqlalchemy. Thanks
> to everyone who created the package, this simplifies things a lot. Will the
> package be contributed with Zope3 itself in the future, as it is in
> the "zope." namespace?
>
> I just have a look at it and it looks fairly simple. What I don't understand
> ist, how/when the Session class should be created:
>
> >>> Session = scoped_session(sessionmaker(
> ... bind=engine,
> ... twophase=TEST_TWOPHASE,
> ... transactional=True, autoflush=True,
> ... extension=ZopeTransactionExtension()))
>
> Can I simply put this statement in one of my modules and import the Session
> class from other modules? This would create the Session class once during
> Zope startup. Does this mean that I don't need a utility anymore, such as in
> z3c.zalchemy?
> Or do I have to create the Session class in each thread, e.g. in my code?
>
> Best Regards,
> Hermann
>
More information about the Zope3-users
mailing list