session.begin()
try:
p=parent()
session.add(p)
session.commit()
c=child()
c.p_id=p.id
session.add(c)
session.commit()
except:
session.rollback()
the example code is error, when c error, it can't rollback p. please
tell me how to do,thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---