Getting DeadLock while updating the table
<p>We are using spring + mybatis +sqlserver.</p>

<p>Scenario is something like we have a table, suppose transaction_table. We received some data while using jdbc inbound channel. After getting the data we do a insert into this table. and we have a status column in this table.</p>

<p>Which needs to be updated after every steps. We have a one persistence layer class which has all the data base function to call the dao layer methods. We are using annotation for transaction handling.. for this we have added @Transaction on the top of the methods.</p>

<p>In dao.xml we have written something like this - </p>

<pre><code>INSERT INTO TRANSACTION_DETAIL(
Column_1, Column_2, Column_3, Column_4
)
&amp;lt;foreach collection="transactionsSubLst" item="element" index="index" separator="union all"&amp;gt;
SELECT

#bean.prop,jdbcType=INTEGER,
#bean.prop2,jdbcType=VARCHAR,
#bean.prop3,jdbcType=VARCHAR,
#bean.prop3,jdbcType=VARCHAR

&amp;lt;/foreach&amp;gt;


&amp;lt;foreach collection="transactionsSubList" item="element" index="index" separator=";"&amp;gt; 
UPDATE TRANSACTION_DETAIL
&amp;lt;set&amp;gt;

Column_3=#element.targetSystem,
Column_4=#element.ruleName,
Column_2=#element.ruleVersion,
Column_1=#element.weightage

&amp;lt;/set&amp;gt;
&amp;lt;where&amp;gt;
Column_1=#element.transactionNo
AND Column_2=#element.requestNumber 

&amp;lt;/where&amp;gt;
&amp;lt;/foreach&amp;gt;
</code></pre>

<p>When we ran this on single node... then we are fine, but as we move to multiple node, we start getting DeadLock on updates..</p>