Improvements #12383
openNested transaction warnings
0%
Description
When an action is to be performed on the Dbo side (read or write), a Wt::Dbo::Transaction
is to be created, which is scoped to the current block. That block will then have access to read from and write to the database.
When a transaction is opened, it is possible to open other in the same scope, leading to nested transactions. While this is in essence harmless, this may be confusing for developers.
It is good practice to scope your transactions small, but in more complex applications, it may happen that nested function calls, would also lead to nested transactions. Due to the transaction committing on destruction, this actual flushing to the database may happen sooner or later than the developer expects. While handling these gracefully, would be hard, we can allow for more information surrounding this.
Wt should detect a nested transaction, and warn the developer of it. Optionally, we can look into a configuration option to disallow it, and actually throw in these cases.
Updated by Matthias Van Ceulebroeck 3 months ago
- Target version changed from 4.11.0 to 4.11.1
Updated by Matthias Van Ceulebroeck 2 months ago
- Target version changed from 4.11.1 to 4.11.3
Updated by Romain Mardulyn 20 days ago
- Status changed from New to InProgress
- Assignee set to Romain Mardulyn
Updated by Romain Mardulyn 20 days ago
- Status changed from InProgress to Review
- Assignee deleted (
Romain Mardulyn)