witten
/
luminotes
Archived
1
0
Fork 0

New rollback() method. Not yet used anywhere.

This commit is contained in:
Dan Helfman 2008-03-17 19:47:56 +00:00
parent 90a31c4e81
commit a4387ea371
1 changed files with 7 additions and 0 deletions

View File

@ -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