Error app-pay-07155 while terminating employee. The HR object which is attempted to be locked is inconsistent. Retry the action with the correct object version number.

If you are facing subject error while terminating and employee. There are following two solutions for this.

 

  1. Set the column COMMENT_ID to null in sqlplus for effected employees.

 

select count(*) from pay_personal_payment_methods_f

where comment_id not in

(select comment_id from hr_comments where comment_id is not null);

 

If rows return then you have to set the comment_id to null these.

update pay_personal_payment_methods_f

set comment_id =”

where comment_id not in

( select comment_id from hr_comments where comment_id is not null);

 

 

  1. There could be problem with Person_type_usage_ID. Same Person_type_usage_id is used in two different PTU records for different person Ids.

    First run following query.

     

    select * from

    per_person_type_usages_f

    where person_type_usage_id

    in

    (select person_type_usage_id from

    (select distinct person_type_usage_id,person_id

    from per_person_type_usages_f

    )

    group by person_type_usage_id

    having count(*) > 1

    )

    order by person_type_usage_id;

     

    if you found the record, It’s means there is problem in these record, these are duplicated person_type_usage_ids. You need to give the unique person_type_usage_Id. For that query per_person_type_usages_s sequence and get next available value. Use following query SELECT per_person_type_usages_s.NEXTVAL seq_no FROM dual; And update person_type_useage_ID with value generated from sequence.