Opened 5 years ago

Closed 2 years ago

#31090 closed New feature (fixed)

Log when DB transactions are commited and rollbacked.

Reported by: Petter Strandmark Owned by: Ilya Bass
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Background: I was debugging database calls today with the django.db.backends log.

Problem: The BEGIN SQL calls show up in the logs, but there is no way to see when the transaction is commited or if it is rolled back.

As easy solution would be to log commits and rollbacks as well.

Change History (14)

comment:2 by Mariusz Felisiak, 5 years ago

Needs tests: set
Owner: changed from nobody to Petter Strandmark
Patch needs improvement: set
Status: newassigned
Summary: Log when DB transactions are commited and rolled backLog when DB transactions are commited and rollbacked.
Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 5 years ago

Needs documentation: set

comment:4 by Mariusz Felisiak, 5 years ago

Note: BEGIN is logged only on SQLite as a workaround to start a transaction explicitly in autocommit mode, you will not find it in loggers for other databases. It is not a start of transaction.

Version 1, edited 5 years ago by Mariusz Felisiak (previous) (next) (diff)

comment:5 by Jacob Walls, 4 years ago

Needs tests: unset
Patch needs improvement: unset

Author updated patch

comment:6 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:7 by Mariusz Felisiak, 2 years ago

Owner: Petter Strandmark removed
Status: assignednew

comment:8 by Ilya Bass, 2 years ago

Owner: set to Ilya Bass
Status: newassigned

Discussed w/ Simon while at DjangoCon US 2022 Sprints, will grab this to try to get this over the line.

comment:10 by Simon Charette, 2 years ago

Patch needs improvement: unset

comment:11 by Jacob Walls, 2 years ago

Needs documentation: unset

comment:12 by Mariusz Felisiak, 2 years ago

Patch needs improvement: set

comment:13 by Mariusz Felisiak, 2 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:14 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In 798e38c2:

Fixed #31090 -- Logged transaction management queries.

Thanks to Petter Strandmark for the original idea and Mariusz Felisiak
for advice during the DjangoConUS 2022 Sprint!

Note: See TracTickets for help on using tickets.
Back to Top