Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DB2 :: -913/-911 Deadlock during UPDATE statement

$
0
0
Author: NoSleep319
Subject: -913/-911 Deadlock during UPDATE statement
Posted: Fri Nov 18, 2016 12:37 am (GMT 5.5)

Hello mainframe guru's! I'm looking for some deadlock insight.

I have a COBOL module that does a SELECT on a table looking for records for that system and that have 'PENDING' in the status column, generates some output if found, updates the status column to 'PROCESSED', then moves onto the next record. This job runs on 27 different partitions/systems and is scheduled every 15 minutes. The table resides on one system and is connected to remotely by the other systems. I'm somewhat new to understanding deadlocks, but I do understand that one program/system is trying to perform an UPDATE while, at the exact same time, another program/system is trying to perform a SELECT. I think I may need to reconstruct my SELECT statement, because there is a column specific to the system, and the SELECT statement queries it's own system records only.

This is my SELECT cursor:
Code:

SELECT UPPER(RACF_ID)                 
     , UPPER(ACTN_CD)                 
     , UPPER(STTS_CD)                 
     , UPPER(ROLE_NM)                 
     , RACF_PRCS_INFO_ID             
  FROM RACF_PRCS_INFO                 
 WHERE RACF_ENV_CD = :WS-RACF-ENV-CD 
   AND STTS_CD = :C-STTS-CD-PEND     
 ORDER BY RACF_ID ASC, RQST_TSTMP DESC


This is my Update statement:
Code:

UPDATE RACF_PRCS_INFO                           
   SET STTS_CD     = 'PROCESSED',               
       CMPLT_TSTMP = CURRENT TIMESTAMP           
 WHERE RACF_PRCS_INFO_ID  = :WS-RACF-PRCS-INFO-ID


Is there a way to query it while it's being updated and not caring that it's updated?


Viewing all articles
Browse latest Browse all 9405

Trending Articles