ttsBegin;
//Delete all added addresses resulting from merge
if (aHACustMerge.changePrimary || aHACustMerge.changeAddress)
{
/*while select survivorDirPartyLocation
where survivorDirPartyLocation.Party == survivor.Party
join survivorLogisticsPostalAddress
where survivorLogisticsPostalAddress.Location == survivorDirPartyLocation.Location
&& survivorLogisticsPostalAddress.HAMergeVictim == victim.AccountNum
{
survivorLogisticsPostalAddress.delete();
}*/
while select survivorDirPartyLocation
where survivorDirPartyLocation.Party == survivor.Party
join survivorLogisticsLocation
where survivorLogisticsLocation.recid == survivorDirPartyLocation.location
&& survivorLogisticsLocation.HAMergeVictim == victim.accountNum
{
survivorLogisticsLocation.selectForUpdate(true);
survivorLogisticsLocation.delete();
}
}
ttsCommit;
For some reason the code above just seems to hang and never finish. At first, I thought the two queries were conflicting with each other and causing deadlock, so I commented out the first one, but it's still hanging. First time deleting records, so maybe I did something wrong. Please let me know. Thanks.
*This post is locked for comments
I have the same question (0)