|
Some idea not properly checked.
fullTextEntityManager.getSearchFactory().disableIndexingFor(fullTextEntityManager); fullTextSession.getSearchFactory().disableIndexingFor(fullTextSession);
Then the underlying disabled session could be extracted from the FullText* objects and stored by FullTextIndexEventListener. The EventSource happens to be that session object and we can do an == comparison. Now the difficulty is how to keep this list of sessions and have it properly garbaged collected. Since there is not Session close hook event, I supposed we could reuse the same approach used for FullTextIndexEventListener.flushSync. I am not quite sure why this one is thread safe but I supposed that it's because the same thread which sets the value also reads it. Which is our case here too.
|