'Commits changes if the system is not in managed transaction mode.'

def commit_unless_managed(self):

    if (not self.is_managed()):
        self._commit()
        self.clean_savepoints()
    else:
        self.set_dirty()
