def __init__(self, name: str, db_engine: Engine):
        """Optimistic Lock

        Args:
            name: lock name should be unique in same thread
        """
        self._name = name
        self._version = 0
        self._has_lock = False
        self.db_engine = db_engine
Optimistic Lock

        Args:
            name: lock name should be unique in same thread
        
web_console_v2/api/fedlearner_webconsole/composer/op_locker.py