I have two dispatcher servlets in my application. I write database related config (sessionfactory etc.) in separate xml file. In each dispatcher servlet config file (abc-servlet.xml, xyz-servlet.xml) I import this common database file.
I am wondering will Spring create two instances of sessionFactory or is it shared with both.
Both application are working fine in my dev environment. I am worried about production if this causes any memory related issues.
I have two dispatcher servlets in my application. I write database related config (sessionfactory
Share
From DispatcherServlet doc:
So, you’re sessionFactory will only be shared if it’s defined in an app context loaded by the ContextLoaderListener, otherwise not.