OceanBase Database supports automatic distributed detection of deadlocks. OceanBase Database can automatically detect and solve deadlocks when the automatic distributed deadlock detection feature is enabled. You must determine whether to commit or roll back the transaction based on the SQL exception information.
Compared with the deadlock handling solution based on transaction timeout, automatic distributed deadlock detection has the following advantages:
OceanBase Database can detect and solve deadlocks promptly to reduce the impact of service deadlocks on system performance.
You can view the deadlocks that occurred in the last seven days and the relevant SQL statements executed to optimize the business logic and prevent deadlocks.
You can check the number of deadlock nodes, interrupted deadlock nodes, and SQL statements executed by each node. The following figure shows the details.
