• DB2 SELECT causing Deadlock!!!!

    From beatls@gmail.com@21:1/5 to All on Thu Mar 21 11:01:26 2019
    HI, I have the same error message when rename and create table, "QL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "2". SQLSTATE=40001". , we use event monitor, and get error message, below:

    Deadlock statement history ...
    Deadlock ID : 0
    Deadlock node : 0
    Participant No : 0
    Application id : *N0.biyjinst.181019080901
    Stmt history ID : 2
    Type : Dynamic
    Section No : 384
    Package cache id : 17983093080064
    Package creator : NULLID
    Package name : SYSLH202
    Package version :
    Lock timeout value : 5
    Nesting level of stmt : 1
    Invocation ID : 1
    Query ID : 281474976710657
    Source ID : 0
    UOW Sequence number : 0003
    Isolation level : Cursor Stability
    Stmt first use time : 10/19/2018 16:08:27.006461
    Stmt last use time : 10/19/2018 16:08:27.006461
    Statement text : SELECT TABNAME FROM SYSCAT.TABLES WHERE TABNAME='HMON_ATM_INFO' AND TABSCHEMA='SYSTOOLS'.

    seems that is question about system view?

    Thanks!

    在 2001年12月12日星期三 UTC+8上午3:23:01,Sushil Singh写道:
    Hi,

    I was wondering how a SELECT query can cause a deadlock. Here is the
    error which I am getting sometime:
    QL0911N The current transaction has been rolled back because of a
    deadlock
    or timeout. Reason code "2". SQLSTATE=40001

    And the SQL is:
    userQuery="export to $outputFileName of del messages $errorFileName
    select b.first_name, b.last_name, g.migrated, e.address_line_1, e.address_line_2, e.city, e.state_abbrev, f.state_name, e.postal_code, a.email_address, b.RECEIVE_NEWSLETTER from user_profile b, user a LEFT
    OUTER JOIN user_contact c on a.user_id = c.user_id and
    c.contact_seq_nbr <= 1 LEFT OUTER JOIN contact d ON c.contact_id = d.contact_id LEFT OUTER JOIN address e ON d.address_id = e.address_id
    LEFT OUTER JOIN state f ON e.state_abbrev = f.state_abbrev LEFT OUTER
    JOIN user_migration_master g on a.email_address = g.email and
    g.migrated = 'Y' where a.user_id = b.user_id and a.email_address is
    not null and a.created >= timestamp('$currDate7Days 00:00:00.000') and a.created < timestamp('$currDateGMT 00:00:00.000') and
    b.receive_newsletter = 'Y' order by b.first_name"

    Thanks in advance!

    Sushil Singh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)