Four Stars

unable to obtain exclusive access to this record: Talend - Salesforce record Update

Hi,

I am trying to update Salesforce records using tSalesforceOutput component using action 'Update'.
But I am getting below error, can someone please help me on this.

Error:
Starting job a_corporate_td_to_sfdc at 07:13 22/05/2017.

[statistics] connecting to socket on port 3742
[statistics] connected
Exception in component tSalesforceOutput_2
java.lang.Exception: unable to obtain exclusive access to this record

    at org.talend.salesforce.SforceManagementImpl.update(SforceManagementImpl.java:416)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.tMysqlInput_1Process(a_corporate_td_to_sfdc.java:5147)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.tWarn_6Process(a_corporate_td_to_sfdc.java:2172)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.runJobInTOS(a_corporate_td_to_sfdc.java:15765)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.main(a_corporate_td_to_sfdc.java:15190)
[statistics] disconnected
Job a_corporate_td_to_sfdc ended at 07:16 22/05/2017. [exit code=1]

11 REPLIES
Seven Stars TRF
Seven Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

This means this record is locked by someone else.

Usualy, if you retry it will be ok or it means there is a transaction engaged on Salesforce side which never stops (surprising because of the Salesforce limits).

Can you share a little more such as job design?


TRF
Four Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Hi,

I tried multiple times on different days, but still same issue persists.

Please find the attached snapshots, it is simple update.

I tried to run by disable the insert link, but no luck.

 sf_1.JPG

sf_2.JPG

Seven Stars TRF
Seven Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Probably due to a trigger, a workflow or a process builder or any Salesforce internal event which fire during the job execution.

Try to do the same operation using DataLoader to verifiy if the same issue occurs or not.

Else, try to define the Salesforce connection first (before the subjob), then reuse it for both operation (insert and update).


TRF
Four Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Hi TRF,

 

I tried with the solution you provided (use Salesforce connection before the sub job).

But still getting same error message.

Seven Stars TRF
Seven Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Can you share tMap_4 + try using DataLoader for some records


TRF
Four Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Hi,

 

I don't have permission to install software, so I am unable to use DataLoader.

Please find the attached snapshot for tmap4.

 

sf_3.JPG

Seven Stars TRF
Seven Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Try with the import wizard (available when connected to Salesforce).
Else, from the job try to remove the user relationship, I suspect a cascade update due to some code on Salesforce side.

TRF
Four Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Hi, Can you please give a clarity to remove the user relationship. Is it available in the tSalesforceOutput component??
Seven Stars TRF
Seven Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Make a copy of your job.
Delete ownerid from tMap and propagate change.
But one more time, you should try to import using the wizard.

TRF
Seven Stars TRF
Seven Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Did you get a solution to your case?

TRF
Four Stars

Re: unable to obtain exclusive access to this record: Talend - Salesforce record Update

Hi,

 

I haven't received a clear solution for my issue.

Since it is Prod environment, It will be difficult to remove ownerId and load the data.

And it was working fine before. I have added new null handling methods in one of the tmap (tmap4) due to the null pointer exception, after that change, this deadlock issue started.

 

sf_4.JPGsf_3.JPGsf_1.JPG