Open topic with navigation
Commit-Time Callbacks
Commit-time callbacks allow a user to add some specific
behavior just before and just after a transaction is committed.
Typical use-cases for commit-time callbacks:
- Add constraint-violation checking before commit.
- Check application-specific conditions before commit is done.
- Start synchronization or backup after commit.
- Notify other clients/applications about
successful/unsuccessful commit.
Commit-time callbacks can be triggered by the following 2 events:
- Committing: Event
subscribers are notified before the container starts any meaningful commit
work and are allowed to cancel the entire operation by throwing an
exception; the object container instance is completely blocked while
subscribers are being notified which is both a blessing because
subscribers can count on a stable and safe environment and a curse because
it prevents any parallelism with the container;
- Committed:
Event subscribers are notified in a separate thread after the container has completely
finished the commit operation; exceptions if any will be ignored.