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,7 +70,8 @@ class DatabaseWrapper(object):
return cursor return cursor
def _commit(self): def _commit(self):
return self.connection.commit() if self.connection:
return self.connection.commit()
def _rollback(self): def _rollback(self):
if self.connection: if self.connection:

View File

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

View File

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

View File

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

View File

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

View File

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