Refactored the PutRevision method in the Database class so that it runs most of the code inside a RunInTransaction call.