Juparave schrieb:
> I didn't understand your approach completely, if I have globals
> variables/callables like ${g} and ${h}, why would I need another
> wrapper (variable_provider)?  With Helpers and Globals I'm covering
> all my bases right now.  Maybe I misunderstand your point.

No, I didn't explain it enough.

The point is that ORMs like SqlAlchemy and SQLObject (and actually 
Java-ORMs often as well) only allow objects to exist inside an ongoing 
transaction (SA encapsulates this within a session). And these objects 
can't be used in another transaction/session.

So you need to "refresh" your objects on each request which spans a 
transaction.

And this is why variable_providers is the place for it.

I'm not aware of a hook that is inoked *after* the DB is connected, but 
only once - you might do that in <package>.config.middlware, when you 
explicitly open and close a transaction.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to