On Apr 23, 11:02 am, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote:
> On 4/21/07, zopyx01 <[EMAIL PROTECTED]> wrote:
>
>
>
> > I've written a wrapper z3c.sqlalchemy that hooks sqlalchemy into the
> > transaction management of Zope.
> > What level of control over sessions/transactions is available from
> > within Elixir?
>

> The only difference here is that you don't create the session
> yourself, so you'd have to call the create_transaction method on the
> objectstore object.
>

z3c.sqlalchemy works the following way.

 - a engine is registered as Zope utility

 - Zope runs multithreaded

 - for every new HTTP request a new SessionContext
   is created for the related thread. The SessionContext
   participates in the transaction system of Zope. This works
   like a charm

- from the registered utility you can obtain a mapper using
  a getMapper() call. A mapper is either auto-generated
  using autoload=True for a given table or it can be configured
  while registering the engine as a utility.

That's the current state. For the next major release I would like
to use Entity instances in order to describe  the model.

 I think it would be possible to rebind the Entity instances during
the getMapper() call using

  newsession.bind_mapper(mapper, myengine)

At least a quick test looks promising. However I don't know yet
how I could initialize the Enitity instances with my own engine
in order to support introspection, autoloading etc.

Andreas



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to