You need to sign in to do that
Don't have an account?
SeAlVa
Problem with SELECT FOR UPDATE in Batch
Hello,
I have a couple of batches that are taking elements from an object that we use as a queue of integration.
the problem is that sometimes they overlap, and I'm getting ENTITY_IS_DELETED.
I decided to add a
But I'm still getting a lot of ENTITY_IS_DELETED exceptions
Any ideas?
(I did in all batches)
Thank you in Advance
Kind Regards
I have a couple of batches that are taking elements from an object that we use as a queue of integration.
the problem is that sometimes they overlap, and I'm getting ENTITY_IS_DELETED.
I decided to add a
Queue__c lock; try{ lock = [SELECT Id FROM Queue__c WHERE ID = :theProcessingElement FOR UPDATE]; } catch (Exception e){ return; } // rest of the logic delete lock;
But I'm still getting a lot of ENTITY_IS_DELETED exceptions
Any ideas?
(I did in all batches)
Thank you in Advance
Kind Regards
Then I tried with FOR UPDATE and it did not get better.