The Transaction Manager is sort of a layer over the revit transactions. Here´s a few more words about it that explain it better than I can:
I guess in this example you could have used TransactionManager.ForceCloseTransaction()
instead ot tran.commit(), but personally i never think about it 
3 Likes