fix before shutdown in entitymanagerfacotry::getInstance()