We have a Java application that works with MariaDB 10.4.28 hosted in AWS RDS.
We have a situation that application went down with reason "CannotCreateTransactionException". The pool has 40 active connections and 0 idle connections.
We have several tools that fire at such moments to help debug such situations:
---TRANSACTION 2974372519, ACTIVE 31 sec
2 lock struct(s), heap size 1128, 0 row lock(s), undo log entries 4
Questions:
We use HikariCP:4.0.3 and mysql-connector-java:8.0.22.
Transactions are stored in INFORMATION_SCHEMA.INNODB_TRX. To find the statement, just execute
SELECT trx_query FROM INFORMATION_SCHEMA.INNODB_TRX WHERE trx_id=2974372519;
See also: INFORMATION_SCHEMA.INNODB_TRX table