File: lock_clear.rst

package info (click to toggle)
groonga 9.0.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,496 kB
  • sloc: ansic: 608,707; ruby: 35,042; xml: 23,643; cpp: 10,319; sh: 7,453; yacc: 5,968; python: 3,033; makefile: 2,609; perl: 133
file content (90 lines) | stat: -rw-r--r-- 2,075 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.. -*- rst -*-

.. highlightlang:: none

.. groonga-command
.. database: lock_clear

``lock_clear``
==============

Summary
-------

.. versionadded:: 4.0.9

``lock_clear`` command clear the lock of the target object
recursively. The target object is one of database, table and column.

.. note::

   This is a dangerous command. You must not use this command while
   other process or thread is doing a write operation to the target
   object. If you do it, your database may be broken and/or your
   process may be crashed.

Syntax
------

This command takes only one optional parameter::

  lock_clear [target_name=null]

If ``target_name`` parameters is omitted, database is used for the
target object. It means that all locks in the database are cleared.

Usage
-----

Here is an example to clear all locks in the database:

.. groonga-command
.. include:: ../../example/reference/commands/lock_clear/database.log
.. lock_clear

Here is an example to clear locks of ``Entries`` table and ``Entries``
table columns:

.. groonga-command
.. include:: ../../example/reference/commands/lock_clear/table.log
.. table_create Entries TABLE_NO_KEY
.. column_create Entries body COLUMN_SCALAR Text
.. lock_clear Entries

Here is an example to clear the lock of ``Sites.title`` column:

.. groonga-command
.. include:: ../../example/reference/commands/lock_clear/column.log
.. table_create Sites TABLE_HASH_KEY ShortText
.. column_create Sites title COLUMN_SCALAR ShortText
.. lock_clear Sites.title

Parameters
----------

This section describes all parameters.

``target_name``
"""""""""""""""

Specifies the name of table or column.

If you don't specify it, database is used for the target object.

The default is none. It means that the target object is database.

Return value
------------

``lock_clear`` command returns whether lock is cleared successfully or
not::

 [HEADER, SUCCEEDED_OR_NOT]

``HEADER``

  See :doc:`/reference/command/output_format` about ``HEADER``.

``SUCCEEDED_OR_NOT``

  If command succeeded, it returns true, otherwise it returns false on error.