Project

General

Profile

Actions

Improvements #12383

open

Nested transaction warnings

Added by Matthias Van Ceulebroeck 10 months ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
02/05/2024
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Matthias Van Ceulebroeck about 2 months ago

  • Target version changed from 4.11.0 to 4.11.1
Actions #2

Updated by Matthias Van Ceulebroeck about 1 month ago

  • Target version changed from 4.11.1 to 4.11.3
Actions

Also available in: Atom PDF