Closed jkavalik closed 7 years ago
Yes, this seems to be very unpredictable and unusable when you want to manipulate with transation yourself.
@jkavalik could you please provide some sample of code with description what is current status and how would you expect it should work?
I have reviews the code and this issue and came to conclusion:
$connection->transactional(function() {
$orm->persistAndFlush(...);
...
$orm->persistAndFlush(...);
});
the aformentioned code will now result in correct transaction nesting:
So, this is fixed in Nextras Dbal 3.0.
Currently even explicitly started transaction is commited during any
flush()
orxAndFlush()
call which quite surprised me. Is there any way to not commit during theflush()
and let the commit/rollback on the user? Or transaction stacking where you have to commit as many times as startTransaction for the commit to actually happen (and any rollback along the way would probably have to change the transaction torollbackOnly
)?