English 中文(简体)
在阅读和撰写数据时,删除2008年Kql服务器的僵局
原标题:removing deadlock issue with sql server 2008 while reading and writing data

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.

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 Deadlock troubleshooting in Sql Server 2008 I have problem with the solution presented here with

浏览版本

我能够利用浏览来避免我局势中的致命锁,我如何利用它?

<><>Edit>/strong>

    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 = ?";

因此,我从GIS.MAP.status table and UpdateGIS.MAP.ro/code> table. 实际GIS.MAP.status 表格还更新了每30个附件(整个表格删除并插入,但两项任务除外)。

  1. inserting into GIS.MAP.status goes first and transaction is committed
  2. updating GIS.MAP.ro table goes second and transaction is committed
  3. Finally, The data from GIS.MAP.ro is accessed by many user by third party application. Actually the deadlock occours at this instance.
最佳回答

在大多数情况下,僵局表明,执行你有点错——存在令问题、令lock锁或加入秩序问题。 我建议收集并分析你的僵局()。 MSDN:Analyzing deathlocks with服务器 Profiler, 因此,在出现僵局时,你可能会发现这些障碍的确切位置。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...