Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7035431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:18:12+00:00 2026-05-28T01:18:12+00:00

java.sql.BatchUpdateException: Transaction (Process ID 58) was deadlocked on lock resources with another process and

  • 0

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

row versioning

can I user rowversioning to avoid dead locks in my situation and How could I use it?

Edit

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

So, I select from GIS.MAP.status table and update update GIS.MAP.ro table. Actually GIS.MAP.status table is also update every 30 sec(the whole table is deleted and inserted but the two task

  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.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:18:13+00:00Added an answer on May 28, 2026 at 1:18 am

    In most cases deadlocks indicate that there’s something wrong with your implementation – there’s a problem with query order, locking order or join order. I’d suggest collecting and analyzing your deadlocks (MSDN: Analyzing Deadlocks with SQL Server Profiler) so you may find exact places in your code where deadlocks occur and fix them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The JDBC java.sql.Statement class has a cancel() method. This can be called in another
I'm having a weird case of the classic deadlock exception: Caused by: java.sql.BatchUpdateException: Deadlock
Lots of times in Java logs I'll get something like: Caused by: java.sql.BatchUpdateException: failed
This one has me stumped. I've got a java.sql.ResultSet and I'm pulling string values
I'm using Hibernate with Spring and Hibernate return this error: Caused by: java.sql.BatchUpdateException: Column
I have a sql exception from clojure that goes like this: java.lang.Exception: transaction rolled
I have a java.sql.ResultSet object containg data from a query that was run. How
How do I formate a java.sql Timestamp to my liking ? ( to a
I have a class User with one field called birthDate which is a java.sql.Date
The following is my Class code import java.net.*; import java.util.*; import java.sql.*; import org.apache.log4j.*;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.