Hi,
I'm using SAContext to manage my SQLAlchemy database connections. Today
setup looks like this.
BaseController.__call__:
model.sac.session.clear()
self.db = model.DatabaseFacade()
And DatabaseFacade.__init__:
self.session = sac.session
self.meta = sac.get_met
I didn't think you had to do that, I thought all you had to do was use
sac directly. so in your base you could add
from model import sac
I think That should work
Jose
On Aug 1, 1:30 am, "Max Ischenko" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using SAContext to manage my SQLAlchemy database conn
On 8/1/07, Max Ischenko <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using SAContext to manage my SQLAlchemy database connections. Today
> setup looks like this.
>
> BaseController.__call__:
>
> model.sac.session.clear()
> self.db = model.DatabaseFacade()
>
> And DatabaseFacade.__
Hello Mike,
On 8/3/07, Mike Orr <[EMAIL PROTECTED]> wrote:
>
>
> > Is it optimal setup? What if make a DatabaseFacade created just once,
> > instead of per-request? Would it remain thread-safe?
>
> No. sac.session is the session appropriate to the current thread (and
> application for multi-app
Dear Max,
I just found out that we should be deleting the current session in
base.py. So in
base.py you should have
del model.sac.session_context.current
which effectively would "clear" the session which is what I think you
wanted from your original post See the thread that I started about
t
Hi Jose!
Now I´m confused, I thought one was supposed to delete the sessions at
the beginning of the controller function in question, does putting
the call in base.py eliminate the need to add del calls in every
controller function?
Thanks
On Aug 8, 5:33 am, jose <[EMAIL PROTECTED]> wrote:
> D
Yes it does, since it's in the base controller.
On 8/8/07, voltron <[EMAIL PROTECTED]> wrote:
>
> Hi Jose!
>
> Now I´m confused, I thought one was supposed to delete the sessions at
> the beginning of the controller function in question, does putting
> the call in base.py eliminate the need to a
Cool, nice to know!
On Aug 8, 7:19 pm, "Daniel Tang" <[EMAIL PROTECTED]> wrote:
> Yes it does, since it's in the base controller.
>
> On 8/8/07, voltron <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Jose!
>
> > Now I´m confused, I thought one was supposed to delete the sessions at
> > the beginning of
Hi Jose,
On 8/8/07, jose <[EMAIL PROTECTED]> wrote:
>
> I just found out that we should be deleting the current session in
> base.py. So in
>
> base.py you should have
>
> del model.sac.session_context.current
>
> which effectively would "clear" the session which is what I think you
> wanted from