1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

[multi-db] For all backends: commit only when a connection exists.

git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4127 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jason Pellerin 2006-11-28 15:48:39 +00:00
parent 7e6d1365ba
commit e4e6bf0712
6 changed files with 12 additions and 6 deletions

View File

@ -70,6 +70,7 @@ class DatabaseWrapper(object):
return cursor
def _commit(self):
if self.connection:
return self.connection.commit()
def _rollback(self):

View File

@ -91,6 +91,7 @@ class DatabaseWrapper(object):
return cursor
def _commit(self):
if self.connection:
self.connection.commit()
def _rollback(self):

View File

@ -36,6 +36,7 @@ class DatabaseWrapper(object):
return FormatStylePlaceholderCursor(self.connection)
def _commit(self):
if self.connection:
self.connection.commit()
def _rollback(self):

View File

@ -43,6 +43,7 @@ class DatabaseWrapper(object):
return cursor
def _commit(self):
if self.connection:
return self.connection.commit()
def _rollback(self):

View File

@ -44,6 +44,7 @@ class DatabaseWrapper(object):
return cursor
def _commit(self):
if self.connection:
return self.connection.commit()
def _rollback(self):

View File

@ -56,6 +56,7 @@ class DatabaseWrapper(local):
return cursor
def _commit(self):
if self.connection:
self.connection.commit()
def _rollback(self):