TransactionManager vs Transaction

The transaction manager is just a layer around the regular revit transactions that manages them for you. It’s preferable to use it instead of regular transactions because that way, if your script crashes before a transaction can be committed, the manager will make sure to finalize everything and do all the necessary cleanup. Otherwise you’ll end up with a stray open transaction, at least until revit’s built-in utilities can clean it up.

If you need to do any rollbacks, you can always open a sub-transaction inside a dynamo controlled transaction. Sub-transaction can only exist in an open transaction and should not be able to lock down your document.

19 Likes