transactionSetSavepoint

Set savepoint for transaction

transactionSetSavepoint(savepoint) → returns void

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(); 
  } 
}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub