Project

General

Profile

Actions

Improvements #12383

closed

Nested transaction warnings

Added by Matthias Van Ceulebroeck about 1 year ago. Updated 20 days ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
02/05/2024
Due date:
% Done:

100%

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 5 months ago

  • Target version changed from 4.11.0 to 4.11.1
Actions #2

Updated by Matthias Van Ceulebroeck 5 months ago

  • Target version changed from 4.11.1 to 4.11.3
Actions #3

Updated by Romain Mardulyn 3 months ago

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

Updated by Romain Mardulyn 3 months ago

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

Updated by Matthias Van Ceulebroeck about 2 months ago

  • Assignee set to Matthias Van Ceulebroeck
Actions #6

Updated by Matthias Van Ceulebroeck 20 days ago

  • Status changed from Review to Implemented @Emweb
  • % Done changed from 0 to 100
Actions #7

Updated by Matthias Van Ceulebroeck 20 days ago

  • Status changed from Implemented @Emweb to Implemented @Test
Actions #8

Updated by Matthias Van Ceulebroeck 20 days ago

  • Status changed from Implemented @Test to Closed
Actions

Also available in: Atom PDF