Hi,
when from my pygtk application i commit, I really do::
if self.session.autocommit:
self.session.begin()
self.session.commit()
I'm normally using session.autocommit = True as a mean to prevent all
those 'idle in transaction' processes (that prevent me from changing the
structure of the database - I use PostgreSQL). moreover I use
autoflush=False to prevent flushing objects when I just need to ge more
info from the database via normal 'select'.
Everything seems to work nicely apart the fact that using this along with
after_commit hook in SessionExtension, turns out in a double call of the
hook. The first when I run session.begin() and the second when I run
session.commit().
Is there a way to prevent the double call of the hook, i.e. double call
of session.commit()?
I tried issuing just self.begin() but that leaves the session with an
open transaction (as long as I understand) and the second time I try it
SA complains a transaction has already begun.
Any hints on how to cope with this?
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
-~----------~----~----~----~------~----~------~--~---