def tpc_finish(transaction, func=lambda tid: None):
    """Finish the transaction, making any transaction changes permanent.

        Changes must be made permanent at this point.

        This call raises a StorageTransactionError if the storage
        isn't participating in two-phase commit or if it is committing
        a different transaction.  Failure of this method is extremely
        serious.

        The first argument is the same object passed to tpc_begin.

        The second argument is a call-back function that must be
        called while the storage transaction lock is held.  It takes
        the new transaction id generated by the transaction.

        The return value may be None or the transaction id of the
        committed transaction, as described in IMultiCommitStorage.
        """
