def commit_unless_managed():
 if (not is_managed()):
  connection._commit()
 else:
  set_dirty()

def commit_unless_managed ( ) : if ( not is_managed ( ) ) : connection . _commit ( ) else : set_dirty ( )
commits changes if the system is not in managed transaction mode .