I frequently want to have bulk operations do zero indexing incrementally, but I want the default behavior to be to index incrementally via sync or async via in memory queue.
It seems like the only options are global configurations of none/async/sync, and more fine grained async options. But usually I want the default to be incremental indexing via sync(or async via in memory queue).
Looking at the javadoc, there appears to be no way to say someFullTextSession.setIndexingMode(none/async/sync);
Or am I missing something?
I'm currently running into an issue where I'm using a JTATransaction manager + using the Spring transaction API's, where I'm committing, then I get a lazy init exception around:
Daemon Thread [ImportThread_ImportTaskID_53] (Suspended (exception LazyInitializationException)) JavassistLazyInitializer(AbstractLazyInitializer).initialize() line: 167 JavassistLazyInitializer(AbstractLazyInitializer).getImplementation() line: 215 DocumentBuilderIndexedEntity<T>.unproxy(Object) line: 533 DocumentBuilderIndexedEntity<T>.buildDocumentFields(Object, Document, PropertiesMetadata, Map<String,String>, Set<String>) line: 425 DocumentBuilderIndexedEntity<T>.buildDocumentFields(Object, Document, PropertiesMetadata, Map<String,String>, Set<String>) line: 484 DocumentBuilderIndexedEntity<T>.buildDocumentFields(Object, Document, PropertiesMetadata, Map<String,String>, Set<String>) line: 484 DocumentBuilderIndexedEntity<T>.buildDocumentFields(Object, Document, PropertiesMetadata, Map<String,String>, Set<String>) line: 484 DocumentBuilderIndexedEntity<T>.getDocument(T, Serializable, Map<String,String>) line: 414 DocumentBuilderIndexedEntity<T>.createAddWork(Class<T>, T, Serializable, String, boolean) line: 364 DocumentBuilderIndexedEntity<T>.addWorkToQueue(Class<T>, T, Serializable, WorkType, List<LuceneWork>, SearchFactoryImplementor) line: 348 BatchedQueueingProcessor.addWorkToBuilderQueue(List<LuceneWork>, Work<T>) line: 264 BatchedQueueingProcessor.processWorkByLayer(List<Work>, int, List<LuceneWork>, Layer) line: 251 BatchedQueueingProcessor.prepareWorks(WorkQueue) line: 149 PostTransactionWorkQueueSynchronization.beforeCompletion() line: 85 EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(SessionImplementor) line: 159 ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion() line: 533 ActionQueue.beforeTransactionCompletion() line: 210 SessionImpl.beforeTransactionCompletion(Transaction) line: 563 JDBCContext.beforeTransactionCompletion(Transaction) line: 229 CacheSynchronization.beforeCompletion() line: 96 Sync2Sync.beforeCompletion() line: 73 TxActiveStateHandler(TransactionStateHandler).commit() line: 253 CompositeTransactionImp.doCommit() line: 511 CompositeTerminatorImp.commit() line: 138 TransactionImp.commit() line: 317 TransactionManagerImp.commit() line: 613 UserTransactionImp.commit() line: 168 JtaTransactionManager.doCommit(DefaultTransactionStatus) line: 1009 JtaTransactionManager(AbstractPlatformTransactionManager).processCommit(DefaultTransactionStatus) line: 754 JtaTransactionManager(AbstractPlatformTransactionManager).commit(TransactionStatus) line: 723 SpringTxUtil.commit(TransactionStatus, PlatformTransactionManager) line: 49
So far I haven't been able to track down why the session is null, since the commit has not yet finished. It just happens to be that the code around this is a good candidate to disable incremental indexing, and I would do that to work around this issue, but the option seems to again be unavailable.
Is this, per session indexing mode control, not possible? If not is it being considered?
Any ideas on the issue I'm attempting to work around would also be appreciated.
Thx.
|