mode is optional, default to transaction