Manual:$wgDebugDBTransactions

Details
This setting enables additional transactions>Special:MyLanguage/Database transactions|database transaction lifecycle tracing in the debug output:

Transaction state changed from IDLE -> TRANS

Whenever transaction status is changed

no database transaction is open a transaction has been open a transaction is in an error state
 * IDLE:
 * TRANS:
 * ERROR:

Example output:

Query trunk (15) (slave): BEGIN Transaction state changed from IDLE -> TRANS Query trunk (16) (slave): SELECT /* DatabasePostgres::schemaExists */  1 FROM "pg_catalog"."pg_namespace" WHERE nspname = 'mediawiki'  LIMIT 1 Query trunk (17) (slave): SELECT /* DatabasePostgres::getSchemas */ current_schemas(false) Schema "mediawiki" already in the search path Query trunk (18) (slave): COMMIT Transaction state changed from TRANS -> IDLE