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