On Feb 16, 2011, at 4:18 PM, Jason McKellar wrote: > > > On Wed, Feb 16, 2011 at 11:51 AM, Michael Bayer <mike...@zzzcomputing.com> > wrote: > > On Feb 16, 2011, at 10:22 AM, Landreville wrote: > > Is there a way to run a command at the beginning of every session, > > before anything else is run? > > SessionExtension has an after_begin() hook for this purpose. > > > That is perfect -- except maybe it's too soon. Is there a way to run > something before the first non-select statement in the session?
I think at that point you'd have to get in on events at the engine level, which in 0.6 is ConnectionProxy. I'm going to poke around 0.7 a bit on this as ConnectionProxy, and the newer implementation in sqlalchemy.event, consider execution events to be an engine-level setting. Want to see if this can be brought to the Connection level if needed. If you're starting a new project I'd recommend 0.7 overall. Will put out beta2 today or tomorrow. > > The reason being I am running Pylons with repoze.what and repoze checks the > database for the username and then the controller action is run using the > same transaction that repoze.what looked up the username in. > > If this isn't possible I will figure out a way to end the transaction > repoze.what uses. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.