Re: [sqlalchemy] I'm missing something with the session...

2011-03-24 Thread Wichert Akkerman
On 3/23/11 23:11 , Hector Blanco wrote: Yeah... the closing thing is because this is going to be in a webserver, and the framework that controls the requests really, really messed up everything (mysql daemon, sqlalchemy...) if the http request was canceled (If I had a user pressing F5 in Firefox

Re: [sqlalchemy] I'm missing something with the session...

2011-03-24 Thread Hector Blanco
Oh... I'll give it a try... I'm using some parts of z3c.saconfig without knowing too well what they do... I took this tutorial: http://grok.zope.org/documentation/how-to/orm-using-megrok.rdb-and-sqlalchemy ... and I didn't look much further. I'll try to dig into the packages you mentioned.

[sqlalchemy] I'm missing something with the session...

2011-03-23 Thread Hector Blanco
Hello everyone... I am getting detached instances error and I don't really know why. There's something I don't get with the session, but I have been reading the documentation thoroughly, trying many things and I can't get rid of all the DetachedInstance exceptions... That's why I think I'm doing

Re: [sqlalchemy] I'm missing something with the session...

2011-03-23 Thread Michael Bayer
There's a lot of detail here but the antipattern I see is you're creating a session just to do a getById() then closing it.A single Session should frame a logical series of operations. When those operations are complete, you commit your session if needed, close it out, then throw

Re: [sqlalchemy] I'm missing something with the session...

2011-03-23 Thread Hector Blanco
Yeah... the closing thing is because this is going to be in a webserver, and the framework that controls the requests really, really messed up everything (mysql daemon, sqlalchemy...) if the http request was canceled (If I had a user pressing F5 in Firefox all the time, I got coredumps that