summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Kelly <ian.g.kelly@gmail.com>2009-03-10 18:38:45 +0000
committerIan Kelly <ian.g.kelly@gmail.com>2009-03-10 18:38:45 +0000
commit9a5942cd6011783037e94b01ea3553a3c08dc69c (patch)
tree628e6a9952a7ef9cc5747207e69d8a6aef690e3e
parent6ab4b64bd04ea09d59c56ff9bb5384eaaafdadaa (diff)
[1.0.X] Backport of 10022 from trunk. Added savepoint support to the Oracle backend, necessary per the thread at http://groups.google.com/group/django-developers/browse_thread/thread/c87cf2d97478c068/
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10023 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/backends/oracle/base.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index 70d1e9b803..a2b1196d85 100644
--- a/django/db/backends/oracle/base.py
+++ b/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):
@@ -147,6 +148,12 @@ WHEN (new.%(col_name)s IS NULL)
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
@@ -293,6 +300,10 @@ class DatabaseWrapper(BaseDatabaseWrapper):
cursor = FormatStylePlaceholderCursor(self.connection)
return cursor
+ # Oracle doesn't support savepoint commits. Ignore them.
+ def _savepoint_commit(self, sid):
+ pass
+
class OracleParam(object):
"""