| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
.. groonga-command |
| 4 |
.. database: lock_clear |
| 5 |
|
| 6 |
``lock_clear`` |
| 7 |
============== |
| 8 |
|
| 9 |
Summary |
| 10 |
------- |
| 11 |
|
| 12 |
.. versionadded:: 4.0.9 |
| 13 |
|
| 14 |
``lock_clear`` command clear the lock of the target object |
| 15 |
recursively. The target object is one of database, table and column. |
| 16 |
|
| 17 |
.. note:: |
| 18 |
|
| 19 |
This is a dangerous command. You must not use this command while |
| 20 |
other process or thread is doing a write operation to the target |
| 21 |
object. If you do it, your database may be broken and/or your |
| 22 |
process may be crashed. |
| 23 |
|
| 24 |
Syntax |
| 25 |
------ |
| 26 |
|
| 27 |
This command takes only one optional parameter:: |
| 28 |
|
| 29 |
lock_clear [target_name=null] |
| 30 |
|
| 31 |
If ``target_name`` parameters is omitted, database is used for the |
| 32 |
target object. It means that all locks in the database are cleared. |
| 33 |
|
| 34 |
Usage |
| 35 |
----- |
| 36 |
|
| 37 |
Here is an example to clear all locks in the database: |
| 38 |
|
| 39 |
.. groonga-command |
| 40 |
.. include:: ../../example/reference/commands/lock_clear/database.log |
| 41 |
.. lock_clear |
| 42 |
|
| 43 |
Here is an example to clear locks of ``Entries`` table and ``Entries`` |
| 44 |
table columns: |
| 45 |
|
| 46 |
.. groonga-command |
| 47 |
.. include:: ../../example/reference/commands/lock_clear/table.log |
| 48 |
.. table_create Entries TABLE_NO_KEY |
| 49 |
.. column_create Entries body COLUMN_SCALAR Text |
| 50 |
.. lock_clear Entries |
| 51 |
|
| 52 |
Here is an example to clear the lock of ``Sites.title`` column: |
| 53 |
|
| 54 |
.. groonga-command |
| 55 |
.. include:: ../../example/reference/commands/lock_clear/column.log |
| 56 |
.. table_create Sites TABLE_HASH_KEY ShortText |
| 57 |
.. column_create Sites title COLUMN_SCALAR ShortText |
| 58 |
.. lock_clear Sites.title |
| 59 |
|
| 60 |
Parameters |
| 61 |
---------- |
| 62 |
|
| 63 |
This section describes all parameters. |
| 64 |
|
| 65 |
``target_name`` |
| 66 |
""""""""""""""" |
| 67 |
|
| 68 |
Specifies the name of table or column. |
| 69 |
|
| 70 |
If you don't specify it, database is used for the target object. |
| 71 |
|
| 72 |
The default is none. It means that the target object is database. |
| 73 |
|
| 74 |
Return value |
| 75 |
------------ |
| 76 |
|
| 77 |
``lock_clear`` command returns whether lock is cleared successfully or |
| 78 |
not:: |
| 79 |
|
| 80 |
[HEADER, SUCCEEDED_OR_NOT] |
| 81 |
|
| 82 |
``HEADER`` |
| 83 |
|
| 84 |
See :doc:`/reference/command/output_format` about ``HEADER``. |
| 85 |
|
| 86 |
``SUCCEEDED_OR_NOT`` |
| 87 |
|
| 88 |
If command succeeded, it returns true, otherwise it returns false on error. |