Note that there are some explanatory texts on larger screens.

plurals
  1. POremoving deadlock issue with sql server 2008 while reading and writing data
    primarykey
    data
    text
    <blockquote> <p>java.sql.BatchUpdateException: Transaction (Process ID 58) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.</p> </blockquote> <p>I have two java application one reading data from sybase and writing to an sql server 2008 and another reading data from sql server 2008 table and writing it to other table. Now the two application works fine. But I have many people accessing data from mssql table where the second application updates data every 30 sec. So I get the above exception. I saw similar thread here in stackoverflow but <a href="https://stackoverflow.com/questions/720508/help-with-deadlock-in-sql-server-2008">Deadlock troubleshooting in Sql Server 2008</a> I have problem with the solution presented here with </p> <blockquote> <p>row versioning</p> </blockquote> <p>can I user rowversioning to avoid dead locks in my situation and How could I use it?</p> <p><strong>Edit</strong></p> <pre><code> String selectAllQuery = "Select new_site_id from GIS.MAP.ro"; String selectQuery = "Select siteId from GIS.MAP.status where AlarmCode in ('1','2','3') and localNodeAlias like 'FLM%'"; String updateQuery = "update GIS.MAP.ro set active_site_status = ? where new_site_id = ?"; String updateAllQuery = "update GIS.MAP.ro set active_site_status = site_status where new_site_id = ?"; </code></pre> <p>So, I select from <code>GIS.MAP.status</code> table and update update <code>GIS.MAP.ro</code> table. Actually <code>GIS.MAP.status</code> table is also update every 30 sec(the whole table is deleted and inserted but the two task </p> <ol> <li>inserting into GIS.MAP.status goes first and transaction is committed </li> <li>updating GIS.MAP.ro table goes second and transaction is committed </li> <li>Finally, The data from GIS.MAP.ro is accessed by many user by third party application. <strong>Actually the deadlock occours at this instance.</strong></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload