KB-2331 How to troubleshoot Database Deadlocks

Purpose

This article details how to identify and remediate MariaDB database deadlocks in Appian.

Database deadlocks occur when two or more transactions are attempting to access the same resource; however neither is able to complete because each transaction is blocking the resource from the other. Additionally any other activities attempting to access the resource will be blocked.

Note: This KB is for customers with Appian Cloud Maria DB. Customers with self-managed databases will need to contact their Database Administrator.

Symptom

You can identify database deadlocks from tomcat-stdOut.log in the <APPIAN_HOME>/logs directory.

Error details: Deadlock found when trying to lock; try restarting transaction
Caused by: org.springframework.dao.DeadlockLoserDataAccessException... Deadlock found when trying to get lock; try restarting transaction..

Instructions

  1. As a user with Database Administrator privileges, access the Cloud Database through the navigation menu.
  2. In phpMyAdmin, navigate to the Appian database using the Databases tab in the toolbar.
  3. View the InnoDB status by running the following stored procedure:
CALL AppianProcess.showEngineInnodbStatus()

The output of this stored procedure will be quite large, so you have to select "Full Text" to find details of the latest deadlock.

Go to "Extra options" > "Full texts" > "Go"


If there are deadlocks, you should see two competing transactions listed as deadlocks.

------------------------
LATEST DETECTED DEADLOCK
------------------------
YYYY-MM-DD HH:MM:SS <DEADLOCK_ID>
*** (1) TRANSACTION:
<TRANSACTION_DETAILS>

*** (2) TRANSACTION:
<TRANSACTION DETAILS>

If there are no deadlocks, you won't see any competing transactions and will get the default output. 

-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 5 srv_active, 0 srv_shutdown, 2092029 srv_idle
srv_master_thread log flush and writes: 2092023
----------
SEMAPHORES
----------
------------
TRANSACTIONS
------------

If there are deadlocks listed in the InnoDB status output

Identify the details of both transactions in the deadlock

  • Date and Time of the latest deadlock (US local time) 
  • Thread ID
  • Query ID
  • Query details

If there are no deadlocks listed in the InnoDB status output

Try the following stored procedures to see other types of database locks

CALL AppianProcess.databaseLocks()
CALL AppianProcess.metadataLocks()

Affected Versions

This article applies to all versions of Appian Cloud.

Last Reviewed: February 2025

Related
Recommended