OceanBase Database in MySQL-compatible mode supports the following lock functions:
| Function | Description |
|---|---|
| GET_LOCK | Acquires a named lock. |
| IS_FREE_LOCK | Checks whether the specified lock is free. |
| IS_USED_LOCK | Checks whether the specified lock is in use. |
| RELEASE_ALL_LOCKS | Releases all locks held by the current session. |
| RELEASE_LOCK | Releases the specified lock. |
Prerequisites
If you use a proxy to connect to the cluster, you must also 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 the proxy configurations, see proxy_id, client_session_id_version, and enable_single_leader_node_routing.