Added recreation of session factory prevention