def addBeforeCommitHook(hook, args=(), kws=None):
    """Register a hook to call before the transaction is
        committed.

        The specified hook function will be called after the
        transaction's commit method has been called, but before the
        commit process has been started.

        :param sequence args:
            Additional positional arguments to be passed to the hook.
            The default is to pass no positional arguments.
        :param dict kws:
            Keyword arguments to pass to the hook. The default
            is to pass no keyword arguments.

        Multiple hooks can be registered and will be called in the
        order they were registered (first registered, first called).
        This method can also be called from a hook: an executing hook
        can register more hooks. Applications should take care to
        avoid creating infinite loops by recursively registering
        hooks.

        Hooks are called only for a top-level commit. A savepoint
        creation does not call any hooks. If the transaction is
        aborted, hooks are not called, and are discarded. Calling a
        hook "consumes" its registration too: hook registrations do
        not persist across transactions. If it's desired to call the
        same hook on every transaction commit, then
        `addBeforeCommitHook` must be called with that hook during
        every transaction; in such a case consider registering a
        synchronizer object via `ITransactionManager.registerSynch`
        instead.
        """
