I am doing some testing on Salesforce Transaction controls and noticed something odd. I was wondering if I am missing something or if I am just not following 'best practices'.
System.Savepoint sp = Database.setSavepoint();
SomeClass.someMethod(string jsonString) //Method parses a large JSON string and inserts/updates and deletes data
I have updated that 'someMethod' above to throw different SOQL, DML, CPU errors and they after modifying data and it does not successfully rollback. However simple divide by 0 and explicit exceptions rollback successfully.
Overall my question is when using Salesforce's Database savepoints and rollbacks and a limit error is encountered, does the transaction successfully rollback or does the transaction stop and leave the DB where it stands?