Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added savepoint support to the Oracle backend, necessary per the thre…

  • Loading branch information...
commit a4f1e48ddbc464ed0ccb9c305db721845db91d6b 1 parent 6aa5aac
@ikelly ikelly authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 django/db/backends/oracle/base.py
View
11 django/db/backends/oracle/base.py
@@ -36,6 +36,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
needs_datetime_string_cast = False
uses_custom_query_class = True
interprets_empty_strings_as_nulls = True
+ uses_savepoints = True
class DatabaseOperations(BaseDatabaseOperations):
@@ -151,6 +152,12 @@ def regex_lookup(self, lookup_type):
connection.cursor()
return connection.ops.regex_lookup(lookup_type)
+ def savepoint_create_sql(self, sid):
+ return "SAVEPOINT " + self.quote_name(sid)
+
+ def savepoint_rollback_sql(self, sid):
+ return "ROLLBACK TO SAVEPOINT " + self.quote_name(sid)
+
def sql_flush(self, style, tables, sequences):
# Return a list of 'TRUNCATE x;', 'TRUNCATE y;',
# 'TRUNCATE z;'... style SQL statements
@@ -309,6 +316,10 @@ def _cursor(self, settings):
cursor = FormatStylePlaceholderCursor(self.connection)
return cursor
+ # Oracle doesn't support savepoint commits. Ignore them.
+ def _savepoint_commit(self, sid):
+ pass
+
class OracleParam(object):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.