Hi,

example from Pylons application, but i think that framework doesn't
matter here:

    class DBAccountExtension(orm.interfaces.MapperExtension):
        def after_insert(self, mapper, connection, instance):
            response = hrd.user_create(instance.to_hrd())
            if response['status'] == hrd.STATUS_OK:
                instance.csa = response['resdata']['user']['id']
                db.save_or_update(instance)
                db.commit()
            return orm.interfaces.EXT_CONTINUE

After saving model i'm making request to some API (to save data there
also). API return status information (response['resdata']['user']
['id']) which i want to update in database so i'm trying to do
db.save_or_update(instance) and then db.commit() but after this 2
lines application prints exception:

InvalidRequestError: The transaction is closed

Any solutions?

(sorry for my english).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to