public class SoapMessageProcessor {
private EntityManager em;
private static final Logger logger = Logger.getLogger(SoapMessageProcessor.class);
public SoapMessageProcessor() {
try {
EntityManagerFactory emFactory = Persistence.createEntityManagerFactory("Auditing");
em = emFactory.createEntityManager();
} catch (Exception ex) {
throw new RuntimeException(ex.getMessage());
}
}
Will this leak memory, when this class is being invoked from a asynchronous EJB call?
So I thought of making the EntityManager and EntityManagerFactory static class members. Will that solve the issue?
Some help needed here. When I ran JProfiler. It says that this area is a Hot spot.Especially the createEntityManagerFactory.
Any help in fixing this leak is appreciated.