Niels Thykier 8cefd1a546
Have transactions verify/assert safe usage
Have the transaction code verify that there is at most one active
child at the time and no one is using the parent while child is
active.  This is how the code is intended to be used and also the
code almost certainly does not work otherwise.

The new code does not cover commiting/rolling back a parent before a
child but that is already covered by the existing code (it will
trigger when child transaction is rolled back/committed or when
leaving the contextmanager from start_transaction).

This would have caught 7d758760d1c08bcd3b364f7e6ec76b2c0eafe68a
immediately with an assertion error.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-22 21:12:01 +00:00
..