Extensions
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why does dynatrace shows 2x SQL Commit

danielkl
Newcomer

Hi,

I am investigating a database issue where commit operations seem to take too much time.

My application creates two transactions. First, it starts the main transaction. Then it starts a second transaction, which commits after performing the first insert.

I am trying to understand why, in the distributed traces, I can see a double commit after the first insert, and why there is no commit shown after the second insert—where the main transaction should normally end and commit.

1 REPLY 1

AravindhanV
Advisor

hi @danielkl

Trying to summarize the understanding for the same.

1. Application Opens Two Transactions
If the application starts a main transaction and then a nested/secondary transaction, each performs its own COMMIT. Dynatrace detects both and aggregates them as 2× COMMIT when they occur consecutively.
2. Autocommit Enabled (DB Driver Behavior)
When autocommit is ON, the database driver may automatically commit after a statement, and the application framework may issue an explicit commit afterwards. This results in two commit operations showing as 2× in Dynatrace.
3. Connection Pool / Framework Commit-on-Close
Some frameworks perform a commit when commit() is called and again when the connection is closed or returned to the pool. Dynatrace identifies both operations and aggregates them.
4. Dynatrace Aggregation Logic
Dynatrace groups identical, consecutive SQL operations (such as repeated commits) for cleaner visualization, which is similar to how it aggregates repeated or identical queries in PurePaths.

The application may issue multiple COMMIT operations, and Dynatrace aggregates them into a single ‘2× COMMIT’ entry for clearer visualization.

Hope this helps you to understand.
Thanks
aravind

Featured Posts