Segwise.ai interview question

I was asked to implement a Transaction class in Python with commit and rollback funtionality.