-->
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.  [ 5 posts ] 
Author Message
 Post subject: JPA + @ClassBridge using the EntityManager possible?
PostPosted: Thu Sep 17, 2009 8:43 am 
Newbie

Joined: Fri Apr 18, 2008 3:46 pm
Posts: 2
Hi experts,

The "JPA with Hibernate" books says
"...Another problem is that an entity listener class isn’t allowed to use the EntityManager."

From the "Hibernate Search in Action" book i know that HB Search is implemented with 'HB-entity listener's.
Implies this that ist not allowed to use a JPA-Query within a custom ClassBridge???

If yes, what happens if a classbridge navigates to a lazy-loaded Property which needs to be loaded from the database or applies the restriction only to queries (which normally flushes the EM?)

How can i collect custom index-data with HQL and integrate it in the transparent indexing process?

Thanks,
Jens


Top
 Profile  
 
 Post subject: Re: JPA + @ClassBridge using the EntityManager possible?
PostPosted: Fri Sep 18, 2009 9:11 am 
Newbie

Joined: Fri Apr 18, 2008 3:46 pm
Posts: 2
No one an idea?


Top
 Profile  
 
 Post subject: Re: JPA + @ClassBridge using the EntityManager possible?
PostPosted: Fri Sep 18, 2009 9:44 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
what happens if a classbridge navigates to a lazy-loaded Property which needs to be loaded from the database or applies the restriction only to queries (which normally flushes the EM?)

that just works, I didn't know about the quote from the book; I'll ask anyway.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: JPA + @ClassBridge using the EntityManager possible?
PostPosted: Fri Sep 18, 2009 11:01 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
I've got an answer from Steve (Hibernate proj.lead) and he confirms that there are no problems in doing so,
provided the even is not the "flush" event; Hibernate Search is not using the classbridge during flush, so there are no problems.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: JPA + @ClassBridge using the EntityManager possible?
PostPosted: Wed Oct 14, 2009 4:00 am 
Beginner
Beginner

Joined: Mon Sep 12, 2005 3:27 am
Posts: 48
s.grinovero wrote:
I've got an answer from Steve (Hibernate proj.lead) and he confirms that there are no problems in doing so,
provided the even is not the "flush" event; Hibernate Search is not using the classbridge during flush, so there are no problems.


For the limitation on the "Flush event" see one of the highest voted outstanding bugs http://opensource.atlassian.com/project ... e/HHH-2763 and the statment, that it's a no go to do entity or collection 'work" inside the flush event cycle.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.