• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Mappings being loaded twice

 
Venkat Vm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We are using Spring, Webwork, Hibernate in our web app. Hibernate session factory, and the mappings(hbm.xml files) are being loaded twice in the app server. First during the server startup, next when we load the login page of the app. I noticed this the hibernate/spring logs. I can also see the singificant memory usage being increased from server startup to initial login page.
Could someone please assist me? Thank you for help.

Here is the web.xml:
------------------------------------------------------------------------------------------------------------------------------------------------
<filter>
<filter-name>webwork</filter-name>
<filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter>
<filter-name>ResponseOverrideFilter</filter-name>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
<listener-class>com.opensymphony.webwork.portlet.context.ServletContextHolderListener</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/context/applicationContext-*.xml</param-value>
</context-param>
------------------------------------------------------------------------------------------------------------------------------------------------

The applicationContext xml files contain sessionfactory definition for hibernate and the location of hbm.xml mapping files.

Thank you very much for your help!!

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like config.configure(); is being called eagarly in a startup Listener, and then again in some type of singleton class that runs the first time the application is accessed. Sounds programmatic to me.

-Cameron McKenzie
 
Venkat Vm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cameron,
I checked the code. We are not calling config.configure() anywhere in the code. Can you be bit more specific, which listener you are referring to?

Help me please!

Thanks.
 
Venkat Vm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me here please?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic