-->
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: Seach behavior with HQL bulk operation
PostPosted: Tue Aug 16, 2011 1:56 am 
Newbie

Joined: Thu Mar 10, 2011 12:16 pm
Posts: 7
hi All,

Am inserting objects in bulk using HQL as described in "DML style operation " here: http://docs.jboss.org/hibernate/core/3. ... tch-direct .

The inserted object is hibernate search enabled and has annotations for being indexed. Insertion is successful, yet Lucene search index are not updated. My questions are:

1. do DML style operations skip indexing ?
2. are these newly inserted objects loaded in memory ever? or Hibernate only executes the SQL?

HQL is:
Insert into EntityA(someDate, status, entityB, someOtherId, yetAnotherId)
select current_date(), '1', entityB , 24, 1 from EntityB entityB where entityB.id in (46271)

It will be great if someone could confirm DML style operations' behavior.

regards,
Rajeev


Top
 Profile  
 
 Post subject: Re: Seach behavior with HQL bulk operation
PostPosted: Tue Aug 16, 2011 4:02 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

Automatic indexing is based on entity change events. In the DML style bulk updates you don't have these events and the entities are never loaded in memory.
If you check the Hibernate Search documentation you can see examples on how to to bulk insertions which will update the index. In particular look at the MassIndexer API which is explicitly written for bulk index changes. It has many options helping you to tune its performance as well.

Hope this helps.

--Hardy


Top
 Profile  
 
 Post subject: Re: Seach behavior with HQL bulk operation
PostPosted: Tue Aug 16, 2011 7:47 am 
Newbie

Joined: Thu Mar 10, 2011 12:16 pm
Posts: 7
hi Hardy,

Thanks for the quick reply !
have a great day!

cheers,
Rajeev


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.