Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

question about dead lock

I have two programs : zpztest03,zpztest04.

if we run them at the same time, they can run successfully.

but i just think it meets the deadlock condition.

if we change zpztest04 to zpztest05, we just add a line 'commit work' . the program zpztest05 will be dead. why ????

*********zpztest03**************
Report  ZPZTEST03.
tables: SFLIGHT.
DATA: SFLIGHT_WA TYPE SFLIGHT, SBOOK_WA TYPE SBOOK.
do 100000 times.

  UPDATE SFLIGHT
    SET
      SEATSOCC = SEATSOCC + 1
    WHERE
      CARRID   = 'LH '      AND
      CONNID   = '0400'     AND
      FLDATE   = '19950228'.

    UPDATE SBOOK
    SET
      smoker = ''
    WHERE
      CARRID   = 'LH '      AND
      CONNID   = '0400'     AND
      FLDATE   = '19950228'.
enddo.
******zpztest04****************
Report  ZPZTEST04.
tables: SFLIGHT.
DATA: SFLIGHT_WA TYPE SFLIGHT, SBOOK_WA TYPE SBOOK.
do 100000 times.
*commit work.
    UPDATE SBOOK
    SET
      smoker = ''
    WHERE
      CARRID   = 'LH '      AND
      CONNID   = '0400'     AND
      FLDATE   = '19950228'.
  UPDATE SFLIGHT
    SET
      SEATSOCC = SEATSOCC + 1
    WHERE
      CARRID   = 'LH '      AND
      CONNID   = '0400'     AND
      FLDATE   = '19950228'.

enddo.
**zpztest05****
Report  ZPZTEST06.
tables: SFLIGHT.
DATA: SFLIGHT_WA TYPE SFLIGHT, SBOOK_WA TYPE SBOOK.
do 100000 times.
commit work.
    UPDATE SBOOK
    SET
      smoker = ''
    WHERE
      CARRID   = 'LH '      AND
      CONNID   = '0400'     AND
      FLDATE   = '19950228'.
  UPDATE SFLIGHT
    SET
      SEATSOCC = SEATSOCC + 1
    WHERE
      CARRID   = 'LH '      AND
      CONNID   = '0400'     AND
      FLDATE   = '19950228'.

enddo.

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question