[Bug 1238559] [NEW] Exception causes next transaction to abort
Kasper Dupont
1238559 at bugs.launchpad.net
Fri Oct 11 09:21:24 UTC 2013
Public bug reported:
I have a program, which roughly goes like this:
try: do_something()
except: record_error()
Each of do_something and record_error use @commit_on_success to perform
a database transaction. If the very first operation performed by
do_something raises an IntegrityError, then the transaction in
record_error is immediately aborted.
The exception raised by do_something looked like this:
IntegrityError: null value in column "name_of_recently_added_field" violates not-null constraint
That was due to a misconfiguration, and was expected to happpen:
The exception raised by record_error looked like this:
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block
That is not supposed to happen, since the failed transaction was supposed to have been aborted, and a new should have been started.
Both do_something and record_error experience the exception upon calling
Model.objects.create(...) on two different models.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-psycopg2 2.4.5-1
ProcVersionSignature: Ubuntu 3.2.0-54.82-generic 3.2.50
Uname: Linux 3.2.0-54-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu17.5
Architecture: i386
Date: Fri Oct 11 11:11:20 2013
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
MarkForUpload: True
SourcePackage: psycopg2
UpgradeStatus: Upgraded to precise on 2012-05-08 (520 days ago)
** Affects: psycopg2 (Ubuntu)
Importance: Undecided
Status: New
** Tags: apport-bug i386 precise
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to psycopg2 in Ubuntu.
https://bugs.launchpad.net/bugs/1238559
Title:
Exception causes next transaction to abort
Status in “psycopg2” package in Ubuntu:
New
Bug description:
I have a program, which roughly goes like this:
try: do_something()
except: record_error()
Each of do_something and record_error use @commit_on_success to
perform a database transaction. If the very first operation performed
by do_something raises an IntegrityError, then the transaction in
record_error is immediately aborted.
The exception raised by do_something looked like this:
IntegrityError: null value in column "name_of_recently_added_field" violates not-null constraint
That was due to a misconfiguration, and was expected to happpen:
The exception raised by record_error looked like this:
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block
That is not supposed to happen, since the failed transaction was supposed to have been aborted, and a new should have been started.
Both do_something and record_error experience the exception upon
calling Model.objects.create(...) on two different models.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-psycopg2 2.4.5-1
ProcVersionSignature: Ubuntu 3.2.0-54.82-generic 3.2.50
Uname: Linux 3.2.0-54-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu17.5
Architecture: i386
Date: Fri Oct 11 11:11:20 2013
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
MarkForUpload: True
SourcePackage: psycopg2
UpgradeStatus: Upgraded to precise on 2012-05-08 (520 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/psycopg2/+bug/1238559/+subscriptions
More information about the foundations-bugs
mailing list