Database Reference
In-Depth Information
Step
Mina
Natalie
"AECE767E4BDDC737A7823083A31D564F"Contact
your
application administrator.
Optimistic locking only works when developers modify the same object. The prob-
lem occurs when multiple developers are modifying different objects on the same page
at the same time. Modifying one object may affect the process of the entire page, which
other developers may not be aware of. Pessimistic locking helps prevent trouble in that
scenario. The next section discusses how to do pessimistic locking.
Locking an APEX Page
The easiest way to prevent issues from occurring when developing an application with
multiple developers is to lock a page before working on it. Locking a page prevents
other developers from modifying the page while you're working on it. Developers can
still view the page and its components while a page is locked; they just can't make any
modifications to the page.
The following process locks a page:
1.
On the Page Edit screen, click the Lock icon in the upper-right corner, as
shown in Figure 13-1 .
Figure 13-1. Locking a page
2. You see a report of page locks with a filter for the current page (page 2 in
this example). Select the check box for the current page, and then click the
Lock Checked button.
3. Enter a value for Comment (all page locks require a comment), and click
Lock Page(s) .
4. You're brought back to the Page Locks report, where you see the current
page marked as locked.
Entering meaningful page-lock comments is important because a history of page
locks is maintained. If you use a case-management tool, it's smart to reference the case
number that you're working on when locking a page.
 
 
Search WWH ::




Custom Search