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:
parent
7e6d1365ba
commit
e4e6bf0712
@ -70,7 +70,8 @@ class DatabaseWrapper(object):
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
return self.connection.commit()
|
||||
if self.connection:
|
||||
return self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection:
|
||||
|
@ -91,7 +91,8 @@ class DatabaseWrapper(object):
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
self.connection.commit()
|
||||
if self.connection:
|
||||
self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection:
|
||||
|
@ -36,7 +36,8 @@ class DatabaseWrapper(object):
|
||||
return FormatStylePlaceholderCursor(self.connection)
|
||||
|
||||
def _commit(self):
|
||||
self.connection.commit()
|
||||
if self.connection:
|
||||
self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection:
|
||||
|
@ -43,7 +43,8 @@ class DatabaseWrapper(object):
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
return self.connection.commit()
|
||||
if self.connection:
|
||||
return self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection:
|
||||
|
@ -44,7 +44,8 @@ class DatabaseWrapper(object):
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
return self.connection.commit()
|
||||
if self.connection:
|
||||
return self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection:
|
||||
|
@ -56,7 +56,8 @@ class DatabaseWrapper(local):
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
self.connection.commit()
|
||||
if self.connection:
|
||||
self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection:
|
||||
|
Loading…
x
Reference in New Issue
Block a user