Skip to content

Commit

Permalink
[1.0.X] Backport of 10022 from trunk. Added savepoint support to the …
Browse files Browse the repository at this point in the history
  • Loading branch information
nightflyerkilo committed Mar 10, 2009
1 parent 6ab4b64 commit 9a5942c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions django/db/backends/oracle/base.py
Expand Up @@ -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):
Expand Down Expand Up @@ -147,6 +148,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
Expand Down Expand Up @@ -293,6 +300,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):
"""
Expand Down

0 comments on commit 9a5942c

Please sign in to comment.