Sorry my first message was incomplete (accidental sending):
I solved my problem with the use of a finished callback:
def commit_callback(request):
'''commit or abort the transaction associated with request'''
if request.exception is not None:
transaction.abort()
else:
try:
transaction.commit()
except exc.SQLAlchemyError as e:
print e
transaction.abort()
Is it the right way for handling sqlalchemy exception in a callable view?
Thanks.