NH-3671

Note: Some dialects are doing SQL operations directly, and since they do not have a reference to the session or session factory, they cannot use this functionality.
change this to `Factory` (with capital F)?