cancel
Showing results for 
Search instead for 
Did you mean: 

​select and insert in batches to a table result in TrexUpdate failed on table error

0 Kudos

Hi,

I am inserting records to a table and in doing so, I check if that record already exists and if so I just skip inserting that record.

This table is a column store. And I do the inserts in batches. I use "select TOP 1 1 FROM ABC WHERE ...." to check the existence of records. In the process I get the following error,

[java] class com.sap.db.jdbc.exceptions.BatchUpdateExceptionSapDB - SAP DBTech JDBC: [131]: transaction rolled back by lock wait timeout: TrexUpdate failed on table 'XYZ:ABC' with error: transaction rolled back by lock wait timeout: Lock timeout occurs while waiting RECORD_LOCK of mode EXCLUSIVE(TRANSACTION_ID=35, UPDATE_TRANSACTION_ID=979468), rc=4628(input position 270)

I don't think I run the existence check and the batch insert at the same time, I wonder how this lock occurs. Any help is highly appreciated.

Thank you.

Accepted Solutions (0)

Answers (0)