Project

General

Profile

Actions

Improvements #12383

open

Nested transaction warnings

Added by Matthias Van Ceulebroeck 11 months ago. Updated 20 days ago.

Status:
Review
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 3 months ago

  • Target version changed from 4.11.0 to 4.11.1
Actions #2

Updated by Matthias Van Ceulebroeck 2 months ago

  • Target version changed from 4.11.1 to 4.11.3
Actions #3

Updated by Romain Mardulyn 20 days ago

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn
Actions #4

Updated by Romain Mardulyn 20 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)
Actions

Also available in: Atom PDF