Controlling cache and log for commit