SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Hibernate (JPA) - No Hits -> forced to flush the entityManager to get them

This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Pages: 1 - Last Post: Dec 3, 2011 3:50 AM Last Post By: woolrich
tkrah

Posts: 3
Registered: 4/14/10
Hibernate (JPA) - No Hits -> forced to flush the entityManager to get them
Posted: Apr 14, 2010 8:57 AM
 
  Click to reply to this thread Reply
Hi - followed this 2 docs:

http://www.compass-project.org/docs/latest/reference/html/gps-embeddedhibernate.html
http://www.compass-project.org/docs/latest/reference/html/core-transaction.html

and configured my entityManagerFactory properties for compass like this:

				<prop key="hibernate.cache.use_query_cache">false</prop>
				<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
				<prop key="hibernate.ejb.event.post-update">org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.compass.gps.device.hibernate.embedded.CompassEventListener</prop>
				<prop key="hibernate.ejb.event.post-insert">org.hibernate.ejb.event.EJB3PostInsertEventListener,org.compass.gps.device.hibernate.embedded.CompassEventListener</prop>
				<prop key="hibernate.ejb.event.post-delete">org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.compass.gps.device.hibernate.embedded.CompassEventListener</prop>
				<prop key="hibernate.ejb.event.post-collection-recreate">org.compass.gps.device.hibernate.embedded.CompassEventListener</prop>
				<prop key="hibernate.ejb.event.post-collection-remove">org.compass.gps.device.hibernate.embedded.CompassEventListener</prop>
				<prop key="hibernate.ejb.event.post-collection-update">org.compass.gps.device.hibernate.embedded.CompassEventListener</prop>
				<prop key="compass.engine.connection">file:///tmp/compass_index</prop>
				<prop key="compass.transaction.processor.read_committed.concurrentOperations">false</prop>
				<prop key="compass.transaction.factory">org.compass.core.transaction.JTASyncTransactionFactory</prop>
				<prop key="compass.transaction.managerLookup">com.atomikos.compass.CompassTransactionManagerLookup</prop>


Now using this JUnit Test:

  @Test
  @Transactional
  public void testCompass() {
    for (int i = 0; i < LOOPS; i++) {
      TestEntity t = getDao().createEntity(String.valueOf(i));
      t.setText("Mein Text mit der Nummer " + i);
      getDao().merge(t);
    }
    // flush
    em.flush();
    Compass compass = HibernateJpaHelper.getCompass(em);
    CompassSearchSession session = compass.openSearchSession();
    CompassHits hits = session.find("Text");
    assertEquals(LOOPS, hits.getLength());
    for (CompassHit hit : hits) {
      LOG.info("{}", hit.getData());
    }
    session.close();
  }


all works - i've got 20 hits.

But notice this "em.flush()". If i don't call flush there, nothing will be found, i've get no hit.
How can i force a implicit session flush when compass trys to query for hits?

After calling flush logs shows:

2010-04-14 15:52:41,292 [main]           TRACE org.compass.gps.device.hibernate.embedded.CompassEventListener - Updating [20: 19]
2010-04-14 15:52:41,293 [main]           TRACE org.compass.core.lucene.engine.LuceneSearchEngine - RESOURCE SAVE {TestEntity} [stored/uncompressed,indexed,omitNorms<alias:TestEntity>],[stored/uncompressed,indexed,omitNorms,omitTf<$/TestEntity/id:20>],[stored/uncompressed,indexed,tokenized<text:Mein Text mit der Nummer 19>],[stored/uncompressed,indexed,tokenized<value:19>],[stored/uncompressed,indexed,omitNorms,omitTf<$/uid:TestEntity#20#>]


Now hits can be found - before nothing can be found because its not yet indexed. Have i have to configure something else to trigger a flush @hibernate? thx.
macmakeup12

Posts: 174
Registered: 9/21/11
Re: Hibernate (JPA) - No Hits -> forced to flush the entityManager to get them
Posted: Oct 7, 2011 4:38 AM   in response to: tkrah in response to: tkrah
 
  Click to reply to this thread Reply
http://a123456777.mylivepage.com/http://www.thoughts.com/a123456777ahttp://www.mywebprofile.com/a123456777/blog/http://a123456777.over-blog.com/http://www.darksiders.net/user/a123456777/blogshttp://www.blurty.com/users/a123456777/http://a123456777.fotopages.com/http://www.graphicdesigncommunity.com/blogs.php?action=show_member_blog&ownerID=85833http://www.equestrianblogging.com/blogs/a123456777http://a123456777.createblog.com/blog/http://a123456777.inube.com/http://wu060231.blogtrue.com/http://wu060231.blog.163.com/http://hi.baidu.com/ab123456777a/bloghttp://blog.sina.com.cn/u/2350370677http://17847589.blog.hexun.com/http://blog.sohu.com/people/!d3UwNjAyMzFAaG90bWFpbC5jb20http://www.mackeupcc.19dog.com/blog/http://a123456777.insanejournal.com/http://phlog.net/a123456777http://www.blogstoday.co.uk/bloghome.aspx?username=a123456777http://www.holatu.com/user/a123456777/blogshttp://www.blogusers.com/sme_blog.php?u=a123456777http://www.art-ba-ba.com/blog/U/default.asp?UID=54175http://www.indyarocks.com/profile/profile_main.phphttp://wu060231.eklablog.com/http://www.adultblogs.com/users/a123456777/http://shenen011.tumblr.com/http://a123456777.livejournal.com/http://wu060231.blogspot.es/admin/http://www.freedatingsiteahead.co.uk/blogs.php?action=show_member_blog&ownerID=6264
http://american-idol-stars.com/blog/a123456777http://wu060231.blogoak.com/http://a123456.bloggd.org/http://www.sanalkahve.com/user/chenxin/blogshttp://wu060231.podbean.com/http://vidi.co.il/profile_blogs/tugmcgraw/http://a123456777.nipox.com/http://yaplog.jp/wu060231/http://www.article-live.com/authors/viewaccounthttp://users.section101.com/?page=user_blog&room=a123456777http://woodstockuniverse.com/?page=user_blog&room=a123456777http://fr.weblog.26l.com/weblog.2104449.html
http://yaplog.jp/wu060231/
macmakeup12

Posts: 174
Registered: 9/21/11
Re: Hibernate (JPA) - No Hits -> forced to flush the entityManager to get them
Posted: Oct 7, 2011 4:38 AM   in response to: tkrah in response to: tkrah
 
  Click to reply to this thread Reply
http://a123456777.mylivepage.com/http://www.thoughts.com/a123456777ahttp://www.mywebprofile.com/a123456777/blog/http://a123456777.over-blog.com/http://www.darksiders.net/user/a123456777/blogshttp://www.blurty.com/users/a123456777/http://a123456777.fotopages.com/http://www.graphicdesigncommunity.com/blogs.php?action=show_member_blog&ownerID=85833http://www.equestrianblogging.com/blogs/a123456777http://a123456777.createblog.com/blog/http://a123456777.inube.com/http://wu060231.blogtrue.com/http://wu060231.blog.163.com/http://hi.baidu.com/ab123456777a/bloghttp://blog.sina.com.cn/u/2350370677http://17847589.blog.hexun.com/http://blog.sohu.com/people/!d3UwNjAyMzFAaG90bWFpbC5jb20http://www.mackeupcc.19dog.com/blog/http://a123456777.insanejournal.com/http://phlog.net/a123456777http://www.blogstoday.co.uk/bloghome.aspx?username=a123456777http://www.holatu.com/user/a123456777/blogshttp://www.blogusers.com/sme_blog.php?u=a123456777http://www.art-ba-ba.com/blog/U/default.asp?UID=54175http://www.indyarocks.com/profile/profile_main.phphttp://wu060231.eklablog.com/http://www.adultblogs.com/users/a123456777/http://shenen011.tumblr.com/http://a123456777.livejournal.com/http://wu060231.blogspot.es/admin/http://www.freedatingsiteahead.co.uk/blogs.php?action=show_member_blog&ownerID=6264
http://american-idol-stars.com/blog/a123456777http://wu060231.blogoak.com/http://a123456.bloggd.org/http://www.sanalkahve.com/user/chenxin/blogshttp://wu060231.podbean.com/http://vidi.co.il/profile_blogs/tugmcgraw/http://a123456777.nipox.com/http://yaplog.jp/wu060231/http://www.article-live.com/authors/viewaccounthttp://users.section101.com/?page=user_blog&room=a123456777http://woodstockuniverse.com/?page=user_blog&room=a123456777http://fr.weblog.26l.com/weblog.2104449.html
http://yaplog.jp/wu060231/
eemm

Posts: 68
Registered: 10/31/11
Re: Hibernate (JPA) - No Hits -> forced to flush the entityManager to get them
Posted: Oct 31, 2011 9:14 PM   in response to: tkrah in response to: tkrah
 
  Click to reply to this thread Reply
Coach Outlet Online offer different kinds of coach handbags outlet. Another very important item details from Louis Vuitton Outlet Online, I bet you won't have identified feasible fact of coach outlet online are possibly one of the most option and look for to pursue handbags. Coach Factory Online Store updates quicker with very good good quality with entire Coach Outlet Online at exact value but you can only purchase nike dunk or gucci canvas bag so Coach outlet online store progressively preferred in current years, nearly started to be a ordinary Cheap Coach Purses. Choose Coach Factory Outlet Store, it will allow you on this summer time awesome self-confidence. Seemingly North Face Outlet little visual appeal however the fundamental merchandise could be total accommodate. American stylish pioneer manufacturer new Coach Purses Outlet presented the girl stylist in spring 2010. Louis Vuitton Bags Outlet little shoulder bag are also stylish and grave Coach Outlet. We perform with each other with stylish component to overturn everything. Buying cheap coach purses from Coach Outlet Online substance is completely gauzy and most palpable of which top cheap gucci handbags designer to go with. Welcome order on our Coach Factory Outlet! You can always find a luxury Coach Shoulder Bags that can catch your heart, you will have the surprise when you place the order! Go head!
hogan280

Posts: 180
Registered: 12/3/11
Hogan
Posted: Dec 3, 2011 1:25 AM   in response to: tkrah in response to: tkrah
 
  Click to reply to this thread Reply
riscaldatore seduto accanto any credited grandi uomini, mother quando low haya visto l . a . stessa cosa, mother low c'è da meravigliarsi, my partner and i credited grandi uomini, una penna any mano, una pila di documenti prima di loro, not possesso di not giornale, anche schierati sul tavolinodi fronte any una mappa, my partner and i bambini low è venuto inside pace every trovare l . a . initial. Queshi Bi Yuan Ning ancora 's cello superiore photographic camera da letto giù more quickly. hogan 5 laggiù insieme any Ning Yuan Ruhuasiyu appear una donna giovane, il suo volto sembra prendere sempre not sorriso malizioso, low è l . a . madre si è donne elizabeth L . a . signorina Li Ying Dong Lida chi altro
longchamp

Posts: 272
Registered: 12/1/11
Longchamp
Posted: Dec 3, 2011 3:35 AM   in response to: tkrah in response to: tkrah
 
  Click to reply to this thread Reply
longchamp nom de l . a . propagation dans toute l'Europe comme not symbole de l . a . additionally belle des produits de trip. Jusqu'à aujourd'hui, additionally tard, indépendamment de l'extension de cuir,sac longchamp de soie, ou les montres, les stylos et même des vêtements, sont basées sur le défenseur Longchamp siècle passé raffiné, de qualité et confortable "philosophie du voyage», en commençant comme foundation de pregnancy.www.sacslongchamp-france.org
woolrich

Posts: 142
Registered: 12/3/11
Re: Hibernate (JPA) - No Hits -> forced to flush the entityManager to get them
Posted: Dec 3, 2011 3:50 AM   in response to: tkrah in response to: tkrah
 
  Click to reply to this thread Reply
woolrich è not pioniere nel settore dell'abbigliamento invernale, mother giubbotti Woolrich sono diventati più che le giacche every le piste ghiacciate. Giubbotti Woolrich sono caldi elizabeth confortevoli elizabeth fuori le piste ghiacciate sono calde elizabeth confortevoli, mother sono anche noti every l . a . loro leggerezza elizabeth morbidezza che permette di incorporare giubbotti Woolrich inside not giorno normale vita quotidiana. Appear not marchio di sports activity all'aria aperta, il suo ranking caldi elizabeth impermeabili di superficie fanno focus all'aperto quando fa freddo più piacevole. Every questo motivo queste giacche sono popolare tra gli appassionati di sci.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums