[Django] #31090: Log when DB transactions are commited and rolled back

20 views
Skip to first unread message

Django

unread,
Dec 14, 2019, 5:44:14 PM12/14/19
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rolled back
-------------------------------------+-------------------------------------
Reporter: Petter | Owner: nobody
Strandmark |
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/31090>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 14, 2019, 5:44:36 PM12/14/19
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rolled back
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Petter Strandmark):

Patch: https://github.com/django/django/pull/12219

--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:1>

Django

unread,
Dec 16, 2019, 2:09:21 AM12/16/19
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Petter
| Strandmark
Type: New feature | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => assigned
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* owner: nobody => Petter Strandmark
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:2>

Django

unread,
Dec 16, 2019, 3:28:55 AM12/16/19
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Petter
| Strandmark
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:3>

Django

unread,
Dec 16, 2019, 7:06:45 AM12/16/19
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Petter
| Strandmark
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:4>

Django

unread,
Aug 10, 2020, 7:25:29 AM8/10/20
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Petter
| Strandmark
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0


Comment:

Author updated patch

--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:5>

Django

unread,
Aug 19, 2020, 7:16:55 AM8/19/20
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Petter
| Strandmark
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:6>

Django

unread,
Jul 29, 2022, 6:46:46 AM7/29/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: (none)

Type: New feature | Status: new
Component: Database layer | Version: dev

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: Petter Strandmark => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:7>

Django

unread,
Oct 20, 2022, 3:00:55 PM10/20/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass

Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ilya Bass):

* owner: (none) => Ilya Bass


* status: new => assigned


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:8>

Django

unread,
Oct 20, 2022, 6:32:02 PM10/20/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ilya Bass):

New pull request https://github.com/django/django/pull/16208

--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:9>

Django

unread,
Oct 20, 2022, 6:51:00 PM10/20/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:10>

Django

unread,
Nov 5, 2022, 10:48:03 AM11/5/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:11>

Django

unread,
Nov 7, 2022, 4:50:31 AM11/7/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:12>

Django

unread,
Nov 21, 2022, 3:02:23 AM11/21/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:13>

Django

unread,
Nov 21, 2022, 4:47:56 AM11/21/22
to django-...@googlegroups.com
#31090: Log when DB transactions are commited and rollbacked.
-------------------------------------+-------------------------------------
Reporter: Petter Strandmark | Owner: Ilya Bass
Type: New feature | Status: closed

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"798e38c2b9c46ab72e2ee8c33dc822f01b194b1e" 798e38c2]:
{{{
#!CommitTicketReference repository=""
revision="798e38c2b9c46ab72e2ee8c33dc822f01b194b1e"
Fixed #31090 -- Logged transaction management queries.

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

--
Ticket URL: <https://code.djangoproject.com/ticket/31090#comment:14>

Reply all
Reply to author
Forward
0 new messages