Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: Transaction (Process ID 310) was deadlocked on lock | communication buffer re  RSS feed

 
riju gopi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Am getting below error in production region :

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Transaction (Process ID 310) was deadlocked on lock | communication buffer resources with another process and has been chose
n as the deadlock victim. Rerun the transaction.

For the code :

public void updateMobileNo() {
        Connection con = null;
        PreparedStatement pstmt = null;
        DBDetails dBDetails = new DBDetails();
        try {
          
            con = dBDetails.getConnection();
            pstmt = con.prepareStatement("update CUSTOMERM set MOBILENUMBER = ? where CUSTOMERNUMBER = ?");
            pstmt.setString(1, "91555");
            pstmt.setString(2, "565655655");
            pstmt.execute();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                
            if (pstmt != null) {
                pstmt.close();
                pstmt = null;
            }
           
            } catch (Exception ex) {
                ex.printStackTrace();
               
            }
try {
            if (conn != null) {
                conn.close();
                conn = null;
            }
        } catch (Exception e) {
        }
        }
    }

Please advise ....
 
Dave Tolls
Ranch Hand
Posts: 2809
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've got a deadlock.
This is not something that can be debugged via a forum, though.
You need to figure out what else is locking the table (or row) your update statement is attempting to run against.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!