OceanBase AI Database supports the following functions for lock operations, as shown in the table below.
Function Name |
Description |
|---|---|
| GET_LOCK | Acquires a named lock. |
| IS_FREE_LOCK | Whether the specified lock is idle. |
| IS_USED_LOCK | Specifies whether the 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 configuration:
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 configuration, see proxy_id, client_session_id_version and enable_single_leader_node_routing.