I want to some updates before doing any insert. So I needed the
above.
Now the issue I am facing is that I need all these updates and the
current insert to be in a transaction. That is either all should be
successful or none.
How is that possible with a connection proxy (something like below)?
===========================================================
class MyProxy(ConnectionProxy):
def execute(self, conn, execute, clauseelement, *multiparams,
**params):
if isinstance(clauseelement, Insert):
trans = self.connection.begin()
try:
# Do some updates
# Execute the current insert also
.......
trans.commit()
except:
trans.rollback()
=============================================================
--
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.