Working on porting a J2EE application from Oracle to HANA
I’ve hit a deadlock situation on INSERT-ing data to one of the appplication tables, a thing that didn’t happen in Oracle.
The log show the following deadlock on INSERT statements
Questions:
1. How can INSERT statement cause a deadlock on a table ?
2. How can I configure the HANA log system to show exactly what resource is being held by the relevant threads at the time of the deadlock ?
"...
This is not an HDB error. User or application may cause a deadlock due to incorrect access sequences on shared objects.
current tx CONNECTION_ID=408576, LOGICAL_CONNECTION_ID=408576, THREAD_ID=62668, CLIENT_HOST=127.0.0.1, CLIENT_IP=10.26.181.205, CLIENT_PID=12316, DB USER=AMI, TRANSACTION_ID=77, UPDATE_TRANSACTION_ID=441346, TRANSACTION_TYPE=USER, TRANSACTION_STATE=ACTIVE, TRANSACTION_ISOLATION_LEVEL=RC, TRANSACTION_CACHING_FLAG=0, QUERY_BUFFER_SIZE=48104, NUM_OPENED_CURSORS=0, SQL_STATEMENT="INSERT INTO COMPOUND_REQUEST_INSTANCES(COMPOUND_REQUEST_INSTANCE_ID, COMPOUND_REQUEST_INSTANCE_NAME, start_time, end_time, instance_count, successful_instance_count, IGNORED_BY_RULE, EXCEEDED_INSTANCES_PER_MINUTE, EXCEEDED_BP_LIMIT, BUSINESS_PROCESS_TYPE_ID) VALUES(?,?,?,?,1,?, ?, ?, ?, ?)"
LOCK_TYPE=RECORD_LOCK, LOCK_MODE=EXCLUSIVE, CONTAINER_ID=0, TABLE_ID=163946, TABLE_NAME=OPTIER_TRUNK:COMPOUND_REQUEST_INSTANCES, RECORD_ID=[CS:OID=0x00000354, PARTID=0x0, OFFSET=0xa5cb]
blocked by CONNECTION_ID=408609, LOGICAL_CONNECTION_ID=408609, THREAD_ID=62634, CLIENT_HOST=127.0.0.1, CLIENT_IP=10.26.181.205, CLIENT_PID=12316, DB USER=AMI, TRANSACTION_ID=71, UPDATE_TRANSACTION_ID=441353, TRANSACTION_TYPE=USER, TRANSACTION_STATE=ACTIVE, TRANSACTION_ISOLATION_LEVEL=RC, TRANSACTION_CACHING_FLAG=0, QUERY_BUFFER_SIZE=48104, NUM_OPENED_CURSORS=0, SQL_STATEMENT="INSERT INTO COMPOUND_REQUEST_INSTANCES(COMPOUND_REQUEST_INSTANCE_ID, COMPOUND_REQUEST_INSTANCE_NAME, start_time, end_time, instance_count, successful_instance_count, IGNORED_BY_RULE, EXCEEDED_INSTANCES_PER_MINUTE, EXCEEDED_BP_LIMIT, BUSINESS_PROCESS_TYPE_ID) VALUES(?,?,?,?,1,?, ?, ?, ?, ?)"
LOCK_TYPE=RECORD_LOCK, LOCK_MODE=EXCLUSIVE, CONTAINER_ID=0, TABLE_ID=163946, TABLE_NAME=OPTIER_TRUNK:COMPOUND_REQUEST_INSTANCES, RECORD_ID=[CS:OID=0x00000354, PARTID=0x0, OFFSET=0xa5d5]
blocked by current transaction (TRANSACTION_ID=77, see above for the details)
..."