| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
.. groonga-command |
| 4 |
.. database: lock_release |
| 5 |
|
| 6 |
``lock_release`` |
| 7 |
================ |
| 8 |
|
| 9 |
Summary |
| 10 |
------- |
| 11 |
|
| 12 |
.. versionadded:: 5.1.2 |
| 13 |
|
| 14 |
``lock_release`` command releases the lock of the target object. The |
| 15 |
target object is one of database, table and column. |
| 16 |
|
| 17 |
.. note:: |
| 18 |
|
| 19 |
This is a dangerous command. You must only release locks that you |
| 20 |
acquire by :doc:`lock_acquire`. If you release locks without |
| 21 |
:doc:`lock_acquire`, your database may be broken. |
| 22 |
|
| 23 |
Syntax |
| 24 |
------ |
| 25 |
|
| 26 |
This command takes only one optional parameter:: |
| 27 |
|
| 28 |
lock_release [target_name=null] |
| 29 |
|
| 30 |
If ``target_name`` parameters is omitted, database is used for the |
| 31 |
target object. |
| 32 |
|
| 33 |
Usage |
| 34 |
----- |
| 35 |
|
| 36 |
Here is an example to release the lock of the database: |
| 37 |
|
| 38 |
.. groonga-command |
| 39 |
.. include:: ../../example/reference/commands/lock_release/database.log |
| 40 |
.. lock_acquire |
| 41 |
.. lock_release |
| 42 |
|
| 43 |
Here is an example to release the lock of ``Entries`` table: |
| 44 |
|
| 45 |
.. groonga-command |
| 46 |
.. include:: ../../example/reference/commands/lock_release/table.log |
| 47 |
.. table_create Entries TABLE_NO_KEY |
| 48 |
.. lock_acquire Entries |
| 49 |
.. lock_release Entries |
| 50 |
|
| 51 |
Here is an example to release the lock of ``Sites.title`` column: |
| 52 |
|
| 53 |
.. groonga-command |
| 54 |
.. include:: ../../example/reference/commands/lock_release/column.log |
| 55 |
.. table_create Sites TABLE_HASH_KEY ShortText |
| 56 |
.. column_create Sites title COLUMN_SCALAR ShortText |
| 57 |
.. lock_acquire Sites.title |
| 58 |
.. lock_release 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_release`` command returns whether lock is released successfully |
| 78 |
or not:: |
| 79 |
|
| 80 |
[HEADER, SUCCEEDED_OR_NOT] |
| 81 |
|
| 82 |
``HEADER`` |
| 83 |
"""""""""" |
| 84 |
|
| 85 |
See :doc:`/reference/command/output_format` about ``HEADER``. |
| 86 |
|
| 87 |
``SUCCEEDED_OR_NOT`` |
| 88 |
"""""""""""""""""""" |
| 89 |
|
| 90 |
If command succeeded, it returns true, otherwise it returns false on error. |
| 91 |
|
| 92 |
See also |
| 93 |
-------- |
| 94 |
|
| 95 |
* :doc:`lock_acquire` |
| 96 |
* :doc:`lock_clear` |