Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Multi threaded INSERT result in deadlock and transaction rollback

$
0
0

1. How can INSERT statement cause a deadlock on a table ?

 

It's not a single INSERT that causes this.

As the trace output clearly shows (reformatting goes a long way here), session 408576 wants to insert into table COMPOUND_REQUEST_INSTANCES  a record that should get this record_id:

RECORD_ID=[CS:OID=0x00000354, PARTID=0x0, OFFSET=0xa5cb]

 

This exact record ID however has already been taken by a second insert statement issues by session 408609.

 

So up to here it's simply a common life-lock situation.

Maybe there exists a second pair of update/insert/delete statements from those two sessions that are also intertwined like that - this would then trigger the deadlock resolution.

 

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 ?

 

Well, the trace already shows that. Other than that, you may want to have a look into m_record_locks/m_object_locks system tables.

 

From what I see up to here, the very same thing would have happened with Oracle - there must still be some other change in the application behavior.

 

- Lars


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>