According to the documentation:
An Apex transaction represents a set of operations that are executed as a single unit. All DML operations in a transaction either complete successfully, or if an error occurs in one operation, the entire transaction is rolled back and no data is committed to the database. The boundary of a transaction can be a trigger, a class method, an anonymous block of code, a Visualforce page, or a custom Web service method.
- What does a boundary for a 'class method' mean here? Is it any set of DMLs within a function?
- How do I create a transaction with multiple custom objects?