Opened 4 years ago

Closed 17 months 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, 4 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, 4 years ago

Needs documentation: set

comment:4 by Mariusz Felisiak, 4 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 4 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, 21 months ago

Owner: Petter Strandmark removed
Status: assignednew

comment:8 by Ilya Bass, 18 months 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, 18 months ago

Patch needs improvement: unset

comment:11 by Jacob Walls, 18 months ago

Needs documentation: unset

comment:12 by Mariusz Felisiak, 18 months ago

Patch needs improvement: set

comment:13 by Mariusz Felisiak, 17 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:14 by Mariusz Felisiak <felisiak.mariusz@…>, 17 months 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