SQL: SELECT COUNT() FROM (select c. from((select u.CLIENT_NAME, u.MOBILE_TEL, u.ID_NO, u.ID_KIND, u.CHANNEL_CODE, u.ACTIVITY_NO, u.ACTIVITY_NAME, u.MARKETING_TEAM, u.BRANCH_NO branch_name, u.branch_no, u.AUDIT_OPERATOR_NO, u.AUDIT_OPERATOR_NAME, u.audit_finish_datetime, u.REVIEW_OPERATOR_NO, u.REVIEW_OPERATOR_NAME, u.review_finish_datetime, u.double_operator_no, u.double_operator_name, u.double_finish_datetime, u.REQUEST_DATETIME, u.VIDEO_TYPE, u.mobile_location, u.open_channel, u.channel_name, u.app_id, (case when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘1’ then ‘待见证’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘2’ then ‘见证中’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘a’ then ‘见证挂起’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘3’ then ‘见证通过’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘4’ then ‘见证驳回’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘1’ then ‘待复核’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘2’ then ‘复核中’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘a’ then ‘复核挂起’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘3’ then ‘复核通过’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘4’ then ‘复核驳回’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘1’ then ‘待二次复核’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘2’ then ‘二次复核中’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘a’ then ‘二次复核挂起’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘3’ then ‘二次复核通过’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘4’ then ‘二次复核驳回’ END) task_type, U.busin_type ,b.serial_id,b.request_no,b.create_datetime,b.deal_datetime, (case when b.task_status in (‘1’,‘2’,‘a’) then ‘show’ when b.task_status in (‘3’,‘4’) then ‘noshow’ end ) show_button ,b.task_source ,b.task_status from BUSINFLOWTASK b left join USERQUERYEXTINFO u on b.REQUEST_NO = u.REQUEST_NO where 1=1 and b.task_status not in (‘3’,‘4’) and b.task_type IN ( ? , ? , ? ) and u.branch_no IN ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) and( (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) ) and (b.operator_no = ? or (b.operator_no = ’ ’ and b.push_flag=‘8’)) and (b.not_allow_auditor = ’ ’ or instr(b.not_allow_auditor,?) = 0) and b.task_status in (‘1’,‘2’,‘a’,‘3’,‘4’,‘b’) ) UNION ALL (select u.CLIENT_NAME, u.MOBILE_TEL, u.ID_NO, u.ID_KIND, u.CHANNEL_CODE, u.ACTIVITY_NO, u.ACTIVITY_NAME, u.MARKETING_TEAM, u.BRANCH_NO branch_name, u.branch_no, u.AUDIT_OPERATOR_NO, u.AUDIT_OPERATOR_NAME, u.audit_finish_datetime, u.REVIEW_OPERATOR_NO, u.REVIEW_OPERATOR_NAME, u.review_finish_datetime, u.double_operator_no, u.double_operator_name, u.double_finish_datetime, u.REQUEST_DATETIME, u.VIDEO_TYPE, u.mobile_location, u.open_channel, u.channel_name, u.app_id, (case when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘1’ then ‘待见证’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘2’ then ‘见证中’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘a’ then ‘见证挂起’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘3’ then ‘见证通过’ when b.TASK_TYPE = ‘audit’ and b.TASK_STATUS = ‘4’ then ‘见证驳回’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘1’ then ‘待复核’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘2’ then ‘复核中’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘a’ then ‘复核挂起’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘3’ then ‘复核通过’ when b.TASK_TYPE = ‘review’ and b.TASK_STATUS = ‘4’ then ‘复核驳回’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘1’ then ‘待二次复核’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘2’ then ‘二次复核中’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘a’ then ‘二次复核挂起’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘3’ then ‘二次复核通过’ when b.TASK_TYPE = ‘secondary_review’ and b.TASK_STATUS = ‘4’ then ‘二次复核驳回’ END) task_type, U.busin_type ,b.serial_id,b.request_no,b.create_datetime,b.deal_datetime, (case when b.task_status in (‘1’,‘2’,‘a’) then ‘show’ when b.task_status in (‘3’,‘4’) then ‘noshow’ end ) show_button ,b.task_source ,b.task_status from BUSINFLOWTASK b left join USERQUERYEXTINFO u on b.serial_id = u.REQUEST_NO where 1=1 and u.is_snapshot = ‘1’ and b.task_status in (‘3’,‘4’) and b.task_type IN ( ? , ? , ? ) and u.branch_no IN ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) and( (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) OR (b.task_type = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 1) AND b.task_status = REGEXP_SUBSTR(?, ‘[^-]+’, 1, 2)) ) and (b.operator_no = ? or (b.operator_no = ’ ’ and b.push_flag=‘8’)) and (b.not_allow_auditor = ’ ’ or instr(b.not_allow_auditor,?) = 0) and b.task_status in (‘1’,‘2’,‘a’,‘3’,‘4’,‘b’) )) c order by decode(c.task_status,‘a’,‘6’,‘2’,‘5’,‘1’,‘4’,‘1’) desc , c.create_datetime asc) TOTAL
Cause: java.sql.SQLTransientConnectionException: (conn=3508472) ORA-02049: timeout: distributed transaction waiting for lock
; (conn=3508472) ORA-02049: timeout: distributed transaction waiting for lock; nested exception is java.sql.SQLTransientConnectionException: (conn=3508472) ORA-02049: timeout: distributed transaction waiting for lock