summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolly <olly@ollycope.com>2015-09-04 07:57:52 +0000
committerolly <olly@ollycope.com>2015-09-04 07:57:52 +0000
commit2af7f9f2a76e5611dc7283dd1f18e2805d27112a (patch)
tree15eac233860638afc9f3640d6cb38b5c95beec15
parent7eee5778c6d57fca35c8820c6fef8268dfd26fd5 (diff)
downloadyoyo-2af7f9f2a76e5611dc7283dd1f18e2805d27112a.tar.gz
Remove cursor caching in DatabaseBackend.execute
-rw-r--r--yoyo/backends.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/yoyo/backends.py b/yoyo/backends.py
index 0f8934c..6f431c9 100644
--- a/yoyo/backends.py
+++ b/yoyo/backends.py
@@ -179,15 +179,12 @@ class DatabaseBackend(object):
"""
self.execute("ROLLBACK TO SAVEPOINT {}".format(id))
- _cursor = None
def execute(self, stmt, args=tuple()):
"""
Create a new cursor, execute a single statement and return the cursor
object
"""
- if self._cursor is None:
- self._cursor = self.cursor()
- cursor = self._cursor
+ cursor = self.cursor()
cursor.execute(self._with_placeholders(stmt), args)
return cursor