Форум сайта python.su
session.begin()
try:
1/0
except:
session.rollback()
log.err()
else:
session.commit()
session.close()
session.begin()
try:
...
except Exception:
session.rollback()
log.err()
except BaseException:
session.rollback()
session.close()
log.err()
raise
else:
session.commit()
session.close()
session.begin()
try:
...
except BaseException, exobj:
session.rollback()
log.err()
if not isinstance(exobj, Exception):
session.close()
raise
else:
session.commit()
session.close()
Отредактировано (Окт. 22, 2008 01:52:12)
Офлайн