# groonga - An open-source fulltext search engine and column store.

- 日本語

### Navigation

- index
- next |
- previous |
- Groonga v5.0.4-139-g6629adb documentation »
- 7. Reference manual »
- 7.3. Command »

# 7.3.18. `lock_clear`

## 7.3.18.1. Summary

New in version 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.

## 7.3.18.2. Syntax

`truncate` command takes only one parameter.

There is no required 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.

## 7.3.18.3. Usage

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

Execution example:

    lock_clear
    # [[0, 1337566253.89858, 0.000355720520019531], true]

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

Execution example:

    table_create Entry TABLE_NO_KEY
    # [[0, 1337566253.89858, 0.000355720520019531], true]
    column_create Entry body COLUMN_SCALAR Text
    # [[0, 1337566253.89858, 0.000355720520019531], true]
    lock_clear Entry
    # [[0, 1337566253.89858, 0.000355720520019531], true]

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

Execution example:

    table_create Site TABLE_HASH_KEY ShortText
    # [[0, 1337566253.89858, 0.000355720520019531], true]
    column_create Site title COLUMN_SCALAR ShortText
    # [[0, 1337566253.89858, 0.000355720520019531], true]
    lock_clear Site.title
    # [[0, 1337566253.89858, 0.000355720520019531], true]

## 7.3.18.4. Parameters

This section describes all parameters.

### 7.3.18.4.1. `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.

## 7.3.18.5. Return value

    [HEADER, SUCCEEDED_OR_NOT]

`HEADER`

> See Output format about `HEADER`.

`SUCCEEDED_OR_NOT`

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

### Navigation

- index
- next |
- previous |
- Groonga v5.0.4-139-g6629adb documentation »
- 7. Reference manual »
- 7.3. Command »