3-phase Database Editing
- Validate Phase: A user callback is only needed here if system validation or “description statement” validation is required. All machine-readable YANG statements related to validation are handled automatically by the transaction engine. The validate phase has to complete without error for all modified object instances. No system resources should be allocated or modified during this phase.
- Apply Phase: A user callback is only needed here if system resource reservation is supported. The target database is modified by the transaction engine using fully recoverable edits, whether that is the candidate or running database. The user callback code may support recoverable resource reservation during this phase. After this callback is invoked, either the commit or rollback phases will follow, allowing the user callback code to commit or cleanup any system resources.
- Commit or Rollback Phase: A user callback for the commit phase is needed to apply configuration changes to the system. Once the commit callback has been done for an object instance, no further callbacks will be done for the current transaction. Either the commit callback or the rollback will be invoked, but not both. The transaction engine will construct a new edit to undo configuration changes if a commit partially finishes and some completed edits need to be rolled back.