Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apex Design Patterns

You're reading from   Apex Design Patterns Harness the power of Apex design patterns to build robust and scalable code architectures on the Force.com platform

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher
ISBN-13 9781782173656
Length 256 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Jitendra Zaa Jitendra Zaa
Author Profile Icon Jitendra Zaa
Jitendra Zaa
Anshul Verma Anshul Verma
Author Profile Icon Anshul Verma
Anshul Verma
Arrow right icon
View More author details
Toc

Reproducing concurrency problems in Apex

Let's try to understand and reproduce a concurrency issue in Salesforce. In this chapter, we will take an example of a nonprofit firm, which is funded by many corporates. The fund information is saved in a custom object named fund account. This nonprofit company is in the process of going online and currently does not support a fund transfer using online payment gateways. Interested volunteers of different companies need to call the organization's contact number to provide information about their contributions. The custom object fund account stores the aggregated contributions of all the employees of a company. Now, the foundation has been set up; let's look at a simple case of a concurrency issue.

The following figure shows the schema of the custom object fund account:

Reproducing concurrency problems in Apex

Two employees of the company ABC call the customer service of this nonprofit organization at the same time. The already available fund of the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime