What is the best way to rollback some changes to the database inside an Apex method?
For example, in an Apex method, I insert multiple records (Opportunity / Quote / QuoteLineItems). When I execute my method, I want every DML operation to be executed without any errors. If any error is detected, I want the changes to be rollback (if the error happen between Quote and QuoteLineItem insertion, I want to remove the Opportunity AND Quote).
Savepoint sp = Database.setSavepoint(); the best alternative, or is there something I'm missing?