From a4387ea37137663f19d50834b358d99f337cb72a Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 17 Mar 2008 19:47:56 +0000 Subject: [PATCH] New rollback() method. Not yet used anywhere. --- controller/Database.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controller/Database.py b/controller/Database.py index 7d4e37c..2aee531 100644 --- a/controller/Database.py +++ b/controller/Database.py @@ -120,6 +120,13 @@ class Database( object ): connection.pending_saves = [] + def rollback( self ): + connection = self.__get_connection() + + # if a transaction has begun but not completed, then rollback the current transaction + if connection.get_transaction_status() > 0: + connection.rollback() + def load( self, Object_type, object_id, revision = None ): """ Load the object corresponding to the given object id from the database and return it, or None if