Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 130820
Status: open
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: RANDIR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: It's possible to leave txn_do without either commit or rollback
The following pseudocode while (1) { $schema->txn_do(sub { last; }); } leaves database's transaction in an inconsistent state (started but neither committed nor rolled back). While it's definitely a broken code, such error is really hard to debug and it'd be great if this situation could be caught & detected by DBIx::Class.
On Sat Oct 26 00:53:36 2019, RANDIR wrote: Show quoted text
> The following pseudocode > > while (1) { > $schema->txn_do(sub { > last; > }); > } > > leaves database's transaction in an inconsistent state (started but > neither committed nor rolled back). While it's definitely a broken > code, such error is really hard to debug and it'd be great if this > situation could be caught & detected by DBIx::Class.
Indeed. DBIC already does a very thorough check for this condition after Dancer2 broke its exception handling, but it happens at a place one step removed from where your case would benefit from that check. I will ponder how to expand this to cover the BlockRunner stack...