code: def commit(self):
          
          if hasattr(self.local, 'tx') and self.local.tx:
              tx = self.local.tx.pop()
              tx.commit()
              self._flush_tables()
docs: Commit the current transaction.
  
          Make all statements executed since the transaction was begun permanent.