Hi to all, since some months ago, i've started to develop simple applications using Hibernate. In this time i see something that i don't like, and is the fact that when you run the web application (i use netbeans), when internally entitymanager is initialized, it starts to do something like binding entities or checking if the named queries in entities are correct, and i see that because in Output window of netbeans prints something like this:
My question is, if is possible to tell hibernate not to do that, because for example, in my applications this happens when the user logins in the app so in the first login user feels that application is slow, and i don't like that.
Thanks in advance.
Wanna grow? Learn, live, love people and enjoy life
I dont know if it is similar, But we faced similar issue when a SessionFactory object is created. I guess you can reduce the delay if you instantiate the SessionFactory or EntityManager in ServletContext listener, because it will be called during application startup, the required SessionFactory/EntityManager will be ready by the time first request arrives.
I am a novice in Hibernate hence excuse if some thing sounds stupid!
Joined: Nov 27, 2009
Thanks Srikanth, in my case i'm using Struts 2 so right now i initialize EntityManager from custom interceptor. You don't know if exists something in hibernate like "map the entity the first time that you use it" instead "map all the entities when entitymanager is initialized"?