Hi to all, this is my first post here, and i want to say that this forum looks awesome, it has a lot of content. I have the next situation: I'm working on struts 2 application with Hibernate JPA, so i defined a custom interceptor to initialize an EntityManager if is null or something like that, but i see that when it initializes (in the application this happens on the first request, like when you log in) it starts and binds every named query of each entity, and this does that login takes a few seconds.
It is worst in some cases when i work with 2 persistence units because it loads entities of both contexts, so i just want to know if exists a way to tell hibernate engine that i don't want that he binds each query of entity when EntityManager initializes, instead another solution, like bind an entity the first time that is used or something like that.
If you don get me, i mean about this (this prints the server, Tomcat when EntityManager is initialized):
Code:
...
Apr 13, 2010 4:09:03 PM org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity com.datasoft.invrest.pos.orm.PosProducto on table POS_PRODUCTO
Apr 13, 2010 4:09:03 PM org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: com.datasoft.invrest.orm.SecConfig
Apr 13, 2010 4:09:03 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: SecConfig.findAll => SELECT s FROM SecConfig s
Apr 13, 2010 4:09:03 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
INFO: Binding Named query: SecConfig.findByIdcco => SELECT s FROM SecConfig s WHERE s.idcco = :idcco
Apr 13, 2010 4:09:03 PM org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity com.datasoft.invrest.orm.SecConfig on table SEC_CONFIG
Apr 13, 2010 4:09:03 PM org.hibernate.cfg.AnnotationBinder bindClass
...
Thanks in advance.