Wednesday 29 August 2012

Rolling Back Transactions, Savepoints and Locking Statements - Apex

Here are some additional resources to explore.
Rolling Back Transactions and Savepoints
Apex supports rolling back transactions. You can generate a savepoint which sets a point in the request that corresponds to a state in the database. Any DML statement that occurs after the savepoint can be discarded and the database can be restored to the same initial condition. See Tutorial #10: Executing Data Operations as a Single Transaction in Chapter 3 of this workbook to learn more about Apex transactions.
Locking Statements
Apex allows you to lock an sObject record to prevent other code from making changes to it. Use the FOR UPDATE SOQL statement to lock a record.
sObject Describes
Apex provides methods to perform describes of sObjects. You can obtain a list of all sObjects, as well as a list of fields for an sObject and field attributes. 

No comments:

Post a Comment