thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Advanced

Savepoint

Point in a transaction to which Apex can roll back database changes using Database.rollback.

Definition

Savepoints let code undo DML after an error while continuing. Each setSavepoint and rollback counts against the DML statement limit, and IDs on rolled-back sObjects are not cleared.

Example

Savepoint sp = Database.setSavepoint(); ... Database.rollback(sp);

Exam tip

Rolling back does not reset static variables or clear assigned IDs.

Related terms