I am using the JAX-WS "WebService" annotation on a class to expose its "WebMethod"s as a web service. The class is denoted as the servlet class handling calls to "/MyService".
As essentially a servlet, I would expect an instance of this class to be created once and to basically be a singleton. I have code in the constructor of this class to create an EntityManagerFactory for assignment to a member variable. What I'm seeing is that the constructor is being called for every client request to the web service. This is not good.
Does anyone know what's going on here? Does anyone understand what I'm trying to ask? :)
Thanks.