Hi,
I'm trying to flush deletion of single objects w/o triggering a
complete
commit and even after reading the docs several time I think I have
not got
it right. In a little test I manage to do it correctly: I delete/
flush
single objects and they are DELETEd from the table (at least this
seems to
me...)
In the GUI I use as test, thoght objects are flushed but they come
back unless I issue a session.commit().
At that point I realized that I didn't really understand what would
be the
difference between:
flush()
commit()
I did understand that commit issues a flush... but then... what is a
flush
w/o a commit?
I do see that after flushing session.dirty is empty and setting
bind.echo
= True shows:
DELETE <sqlkit.db.proxy.director_class object at 0x8bb260c>
2008-09-08 00:24:16,882 INFO sqlalchemy.engine.base.Engine.0x...e0cc
DELETE FROM director WHERE director.id = ?
2008-09-08 00:24:16,882 INFO sqlalchemy.engine.base.Engine.0x...e0cc
[19]
DIRTY IdentitySet([]),
Nevertheless if I don't issue a session.commit() the objects I
deleted
come back. (Using sqlite for the test. session.autoflush = True,
autocommit=False )
Thanks for any explanation
sandro
*:-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---