peewee-async
peewee-async copied to clipboard
Using gather inside transaction may leads to errors
async with db.aio_atomic():
await asyncio.gather(t1(), t2(), t3())
It seems fine if all tasks inside gather have no transaction but if t1 and t2 have aio_atomic statement inside it leads to mess of savepoints and errors.
It seems fine if all tasks inside gather have no transaction
any exception in SQL STATEMENT will interrupt outer transaction and cause errors in other tasks too
That's right. Thank you @spumer. As you said the solution is to add kind of forbid_subtask param to aio_atomic which forbids using of aio_atomic in subtasks.
related #215 #123