Re: [sqlalchemy] How to retry failed transactions?

2014-12-01 Thread Guido Winkelmann
On Friday 28 November 2014 16:38:47 Michael Bayer wrote: On Nov 28, 2014, at 9:28 AM, Guido Winkelmann gu...@ambient-entertainment.de wrote: [...] The problem is, in SQLAlchemy, at least with a PostgreSQL+psycopg2 backend, the exception I get when that happens is InvalidRequestError. This is

Re: [sqlalchemy] How to retry failed transactions?

2014-12-01 Thread Michael Bayer
On Dec 1, 2014, at 9:01 AM, Guido Winkelmann gu...@ambient-entertainment.de wrote: This is the full text of the exception that I'm getting: in _assert_active % self._rollback_exception InvalidRequestError: This Session's transaction has been rolled back due to a previous exception

[sqlalchemy] How to retry failed transactions?

2014-11-28 Thread Guido Winkelmann
Hi, What's the best strategy for retrying failed transactions when using SQLAlchemy? Sometimes, transactions fail on commit, through no fault of their own, simply because another concurrent but conflicting transaction finished slightly before them. The commonly accepted best practice seems

Re: [sqlalchemy] How to retry failed transactions?

2014-11-28 Thread Michael Bayer
On Nov 28, 2014, at 9:28 AM, Guido Winkelmann gu...@ambient-entertainment.de wrote: Hi, What's the best strategy for retrying failed transactions when using SQLAlchemy? Sometimes, transactions fail on commit, through no fault of their own, simply because another concurrent but