Commit a4f1e48d authored by Ian Kelly's avatar Ian Kelly
Browse files

Added savepoint support to the Oracle backend, necessary per the thread at...

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/trunk@10022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 6aa5aacc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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 @@ 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
@@ -309,6 +316,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):
    """