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.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/9SQvs9wkQS8J.
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/pylons-discuss?hl=en.

Reply via email to