OceanBase Database in MySQL mode provides the following lock functions:
| Function | Description |
|---|---|
| GET_LOCK | Acquires a named lock. |
| IS_FREE_LOCK | Checks whether a specified lock is free. |
| IS_USED_LOCK | Checks whether a specified lock is in use. |
| RELEASE_ALL_LOCKS | Releases all locks held by the current session. |
| RELEASE_LOCK | Releases a specified lock. |
Prerequisites
If you connect to the cluster by using a proxy, you must enable the following proxy configurations:
ALTER PROXYCONFIG SET proxy_id = 1;
ALTER PROXYCONFIG SET client_session_id_version = 2;
ALTER PROXYCONFIG SET enable_single_leader_node_routing = false;
For more information about these proxy configurations, see proxy_id, client_session_id_version, and enable_single_leader_node_routing.