-->
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.  [ 1 post ] 
Author Message
 Post subject: Multiple Nested IndexEmbedded stale data
PostPosted: Thu Apr 03, 2014 4:01 pm 
Newbie

Joined: Sun Nov 05, 2006 8:41 pm
Posts: 2
hi -

I am able to perform multiple queries and updates and everything seems to be working, with the exception of some nested IndexEmbedded entities after an update.

Here are my entities:

Code:

@Indexed
public class Strain extends BaseEntity {

   @IndexedEmbedded
   @OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy="strain")
   private Set<TestResult> testResults = new HashSet<TestResult>();


Code:

@Entity
public class TestResult extends BaseEntity {

   @ContainedIn
   @ManyToOne(fetch = FetchType.LAZY, optional = false)
   private Strain strain;

   @IndexedEmbedded
   @ManyToOne(fetch = FetchType.LAZY, optional = false)
   private TestType testType;


Code:

@Entity
public class TestType extends BaseEntity {

    @IndexedEmbedded
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private Test test;
   
    @ContainedIn
    @OneToMany(mappedBy="testType")
    private Set<TestResult> testResults = new HashSet<TestResult>();


Code:

@Entity
public class Test extends BaseEntity {

    @ContainedIn
    @OneToMany(fetch = FetchType.LAZY, mappedBy="test")
    private Set<TestType> testTypes = new HashSet<TestType>();



I execute a search, then perform an update on some of the entities, then do another search. The data from the 2nd search is the same as the first and does not reflect the changes to the entities. So, I have stale data. Any ideas on how to refresh the data?

This is how I construct my query:

Code:

FullTextQuery fullTextQuery =
         getFullTextEntityManager()
            .createFullTextQuery(booleanQuery, Strain.class);


I tried calling fullTextEntityManager.flushToIndexes(); but that had no effect. I can see no SQL is being executed for the 2nd search to get the latest updates, just not sure how to enable the indexes to be updated.

I am not sure where to look, so some help is appreciated.

thanks


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

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.