1. System.Limits Class: The Apex Developer Guide explains that the Limits class methods can be used to "check a specific governor limit against the limit for that governor." This is the standard practice for monitoring consumption within a transaction.
Source: Salesforce Apex Developer Guide
"Execution Governors and Limits"
Section: "Checking Governor Limit Consumption".
2. Database.Savepoint and Rollback: The Apex Developer Guide details transaction control
stating
"You can set a savepoint
which is a point in the request that you can roll back to... All DML operations that occurred after the savepoint are rolled back."
Source: Salesforce Apex Developer Guide
"Database Class"
Section: "Transaction Control".
3. @ReadOnly Annotation Restriction: The documentation for Apex annotations explicitly states
"A method defined with the @ReadOnly annotation can't perform DML operations."
Source: Salesforce Apex Developer Guide
"Apex Annotations"
Section: @ReadOnly.
4. Partial DML Statements: The documentation describes the allOrNone parameter for Database methods
which allows for partial success of a DML operation. This is distinct from managing the entire transaction's state with savepoints.
Source: Salesforce Apex Developer Guide
"Database Class"
Section: "DML Operations".