mirror of
https://github.com/django/django.git
synced 2025-09-10 12:36:40 +00:00
Implemented persistent database connections.
Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
This commit is contained in:
parent
d009ffe436
commit
2ee21d9f0d
16 changed files with 220 additions and 25 deletions
|
@ -439,6 +439,14 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||
cursor = self.connection.cursor()
|
||||
return CursorWrapper(cursor)
|
||||
|
||||
def is_usable(self):
|
||||
try:
|
||||
self.connection.ping()
|
||||
except DatabaseError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def _rollback(self):
|
||||
try:
|
||||
BaseDatabaseWrapper._rollback(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue