I have a one to many relationship between Accounts and Contacts: an account can have multiple contacts, and a contact can have only one account.
I want to import accounts and contacts from Salesforce into MySQL. I set up a process that inserts the contacts, and checks if the parent account exists in MySQL or not. If the account doesn't exist, the process inserts it.
The process seems to work fine, except when I try to insert two contacts, in the same transaction, that point to the same account, and that account doesn't exist in MySQL. The account record is inserted twice.
Do you have any ideas why that can happen?