Use split init ctx, event write and commit in different calls