1. Set transaction’s to committing.

    2. Run the following steps :

      1. Wait until every item in transaction’s request list is .

      2. Attempt to write any outstanding changes made by transaction to the database, considering transaction’s .

      3. If an error occurs while writing the changes to the database, then run with transaction and an appropriate type for the error, for example ““ or ““ , and terminate these steps.

      4. Queue a task to run these steps:

        1. Set transaction’s to finished.

        2. named at transaction.

          Even if an exception is thrown from one of the event handlers of this event, the transaction is still committed since writing the database changes happens before the event takes places. Only after the transaction has been successfully written is the event fired.