Skip to content

Conversation

@akaariai
Copy link
Contributor

@akaariai akaariai commented Jul 5, 2012

On PostgreSQL when the transaction is in aborted status, checking
connection.isolation_level will result in error because doing queries
in aborted transactions is illegal. Fixed this by skipping the
isolation level check when the transaction is aborted.

@akaariai
Copy link
Contributor Author

akaariai commented Jul 9, 2012

Looking at this it might be better to just do:

try:
    iso_level = conn.isolation_level:
except DatabaseError:
    iso_level = 'unknown'

in there.

@jezdez
Copy link
Contributor

jezdez commented Jul 12, 2012

Yeah, let's go with the simpler version, @akaariai

@jezdez
Copy link
Contributor

jezdez commented Aug 27, 2012

@akaariai any news on that?

@travisbot
Copy link

This pull request passes (merged 821fbed7 into ad15287).

@travisbot
Copy link

This pull request passes (merged e806603 into ad15287).

@akaariai
Copy link
Contributor Author

I had forgotten all about this. I modified the patch to do the try-except thing. In addition, there is a test in [https://github.com/akaariai/django-debug-toolbar/commit/d9e9bf38cd4f4bd965065fe6380cfa47cea35197] but I didn't figure how to test this properly (without modifying the main settings), so this is non-committable.

On PostgreSQL when the transaction is in aborted status, checking
connection.isolation_level will result in an error.
@jezdez
Copy link
Contributor

jezdez commented Aug 27, 2012

@akaariai we could probably run the tests on postgres by extending the travis configuration and skip the test if the configured database isn't a postgres db. what do you think?

@akaariai
Copy link
Contributor Author

I updated the patch so that running tests using "DJANGO_SETTINGS_MODULE=test_pgsql python runtests.py" is now possible. Along that path I had to fix another issue when using connections with alias not in django.db.connections.

@travisbot
Copy link

This pull request passes (merged 54f4f3a into ad15287).

@nuklea
Copy link
Contributor

nuklea commented Dec 20, 2012

Good request!

@catalanojuan
Copy link
Contributor

Any news on this? Is this going to be merged any time soon? Thanks!

@johtso
Copy link

johtso commented Feb 13, 2013

Got bitten by this issue the other day, would be great if a fix could be merged 👍

@jlovison
Copy link

jlovison commented Mar 2, 2013

I also just got bit by this issue. I also think #351 is because of this.

Does DatabaseError also catch IntegrityError?

Otherwise it should probably read except (DatabaseError, IntegrityError):

@jezdez jezdez merged commit 54f4f3a into django-commons:master Mar 2, 2013
@sturmf
Copy link

sturmf commented Jun 28, 2013

Hmm, I hate to have to write, me too. But any reason this got not merged yet? Can we help in any way on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants