Re: [sqlalchemy] Session: close(), remove(), expire_all() and expunge_all()

2011-03-19 Thread Michael Bayer
if it helps, I was just talking to my co-author (SQLA book) about how when I first wrote versions 0.1, 0.2, my concept of the Session was pretty much what you thought here. We hardy had "expire" at all, it seemed redundant versus expunge() to me (at that time called clear()). Only around 0

Re: [sqlalchemy] Session: close(), remove(), expire_all() and expunge_all()

2011-03-19 Thread Israel Ben Guilherme Fonseca
Thank you very much for the answers. No doubts for now. 2011/3/18 Michael Bayer > > On Mar 18, 2011, at 2:55 PM, Israel Ben Guilherme Fonseca wrote: > > > Hi everybody, > > > > I'm new with SQLAlchemy and I'm trying to understand better the Session > object. > > > > First of all, why the expire

Re: [sqlalchemy] Session: close(), remove(), expire_all() and expunge_all()

2011-03-18 Thread Michael Bayer
On Mar 18, 2011, at 2:55 PM, Israel Ben Guilherme Fonseca wrote: > Hi everybody, > > I'm new with SQLAlchemy and I'm trying to understand better the Session > object. > > First of all, why the expire_all() exists? The purpose is to remove any database-loaded state from all current objects so

[sqlalchemy] Session: close(), remove(), expire_all() and expunge_all()

2011-03-18 Thread Israel Ben Guilherme Fonseca
Hi everybody, I'm new with SQLAlchemy and I'm trying to understand better the Session object. First of all, why the expire_all() exists? Shouldn't it be always better to expunge_all() instead? If it is expired, at the use of the instance another query would be issued to reattach it anyway, so why