use apply() rather than commit().