You are tightly coupling one technology with another. Please don't.
This is not the responsibility of a Servlet. A Servlet takes a request object, gets information from it and should immediately pass it off to some other Java class/code do to the rest of the work. Once the work is done, the data stuff that needs to be sent to a response is passed back into the Servlet from the java call, it is then the Servlets responsibility to take the data put it into the response object, and pass it off to some view, usually a JSP page.
But do not do any business logic, or EntityManager dao/data stuff in Servlet code.
Karl Stenerud wrote:This is not for putting business code in the servlet. This is for getting servlet configuration data from the database.
I want to get an entity manager so that I can inject it into a configuration object that will do the DB magic to get me the configuration options I need to initialize this servlet.
OK. Good glad it is not business code. Personally, I still wouldn't put servlet configuration options into a database, but into a servlet configuration file instead. But that is just my opinion, and you are free to move about the cabin.