-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Avoid query binding on EntityManager initialization
PostPosted: Tue Apr 13, 2010 6:34 pm 
Newbie

Joined: Tue Apr 13, 2010 6:14 pm
Posts: 6
Location: El Salvador
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.

_________________
SCJP 6


Top
 Profile  
 
 Post subject: Re: Avoid query binding on EntityManager initialization
PostPosted: Tue Apr 13, 2010 10:20 pm 
Newbie

Joined: Tue Apr 13, 2010 2:23 am
Posts: 7
nothing! all right!now

◎◎◎◎

_________________
Hobbies Sports: Playing golf!

ping g10 driver*
ping g10 irons|


Top
 Profile  
 
 Post subject: Re: Avoid query binding on EntityManager initialization
PostPosted: Fri Apr 16, 2010 11:51 am 
Newbie

Joined: Tue Apr 13, 2010 6:14 pm
Posts: 6
Location: El Salvador
aliaba, i don't get your answer. Somebody else?

_________________
SCJP 6


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.