Reputation: 443
I have an inbound email handler that's working. However, right now I'm worried about concurrency issues, when a user sends 2 emails at the same time for the same object. (I have a business document form, and a technical document form that gets sent to salesforce.) They contain different things, except for the company name (They get sent over from someone else directly to salesforce).
Since I'm doing an insert of my custom object at the very end, I'm worried about concurrency issues. Will this ever happen? My inbound email handler creates 2 custom objects for the same company and both filling in only half the information.
If so, how can I prevent a concurrency problem from happening? Current Ideas: - Do a query for custom_object right away with the associated account rather than at the very end. If the custom_object does not exist, create one.
Cheers,
Kuen
Upvotes: 0
Views: 1105
Reputation: 324
"Concurrency" in the traditional sense, is rarely an issue on the platform. Each one of your in-bound emails is going to create a separate process (handler) on the platform and operate independently. You have a couple of options to deal with your multi-part email scenario though if you're looking to combine them:
In your shoes, I'd probably do a combination of 2, and then 3 to clean up any you miss.
Upvotes: 3