On Wed, Nov 24, 2010 at 11:25 AM, Ben Bangert <b...@groovie.org> wrote: . I'm sure we can work out something somewhat flexible for changing engine bindings to a session on the fly though, like: > > from pyramid_sqla import set_session_bind > > set_session_bind(session='read_only', engine='db2') > > And it'll switch the engine binding for the session for this request. Or we > could just provide an easy command that lets the person get the configured > engine/session and switch the binding themself, which would prolly be better > as that'd let them stick with more SQLAlchemy knowledge, and pyramid_sqla > would only be making it easy to register engines/sessions and get to them > from anywhere else.
So do we need multiple sessions? I'm not sure we've defined the use cases clearly enough, which runs the risk that we'll make an API that won't be adequate anyway. So I'm inclined to use a single session. We can always add a multisession object later under a different name, and share the default session with it. If people are using the same ORM objects to copy data from one db to another, I think they can use a 'bind' argument on the specific calls. -- Mike Orr <sluggos...@gmail.com> -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-de...@googlegroups.com. To unsubscribe from this group, send email to pylons-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.