# Get Locks Information
```
mysql> show variables like 'transaction_isolation';
+-----------------------+----------------+
| Variable_name         | Value          |
+-----------------------+----------------+
| transaction_isolation | READ-COMMITTED |
+-----------------------+----------------+
1 row in set (0.70 sec)

mysql> show variables like 'tidb_txn_mode';
+---------------+-------------+
| Variable_name | Value       |
+---------------+-------------+
| tidb_txn_mode | pessimistic |
+---------------+-------------+
1 row in set (0.00 sec)
```
------------------------------------------------------------

In TiDB databases, we can choose the isolation level of the transaction, as well as optimistic locking and pessimistic locks.

We choose optimistic locks in scenario where concurrency is high and there are not many conflicts, but we generally choose pessimistic locks for scenario with a high probability of conflict.

As for the isolation level, the choice is based on application development habits.

