From 4f4f99dff3f0e53506fbc30875cf343c6c7af7bc Mon Sep 17 00:00:00 2001 From: Brant Steen Date: Tue, 24 Jun 2014 15:37:36 -0400 Subject: [PATCH] Just following suit, as found in backends.postgresql_psycopg2.base --- django_postgrespool/base.py | 6 ++++-- setup.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/django_postgrespool/base.py b/django_postgrespool/base.py index 3545fff..7913c47 100644 --- a/django_postgrespool/base.py +++ b/django_postgrespool/base.py @@ -98,11 +98,13 @@ class DatabaseWrapper(Psycopg2DatabaseWrapper): def _commit(self): if self.connection is not None and self.connection.is_valid: - return self.connection.commit() + with self.wrap_database_errors: + return self.connection.commit() def _rollback(self): if self.connection is not None and self.connection.is_valid: - return self.connection.rollback() + with self.wrap_database_errors: + return self.connection.rollback() def _dispose(self): """Dispose of the pool for this instance, closing all connections.""" diff --git a/setup.py b/setup.py index 603b836..13ef11f 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ required = [ setup( name='django-postgrespool', - version='0.2.5', + version='0.2.6', description='Postgres Connection Pooling for Django.', long_description=open('README.rst').read(), author='Kenneth Reitz',