transactionSetSavepoint

Set savepoint for transaction

transactionSetSavepoint(savepoint) → returns void

transactionSetSavepoint Argument Reference

savepoint string
Required

Savepoint name to which can be rolled back

Examples sample code invoking the transactionSetSavepoint function

This example runs multiple queries with a savepoint for each, and rolls back to the 'useradded' savepoint if the last query fails.

transaction { 
  // insert user 
  transactionSetSavepoint('useradded'); 
  try { 
    // another query 
  } 
  catch(any e) { 
   transactionRollback(); 
  } 
}

Fork me on GitHub