2010-12-02 9 views
4

新しいプロジェクトをHibernate Searchで使用しようとしています。私たちはJPAなしでHibernateとSpringを持っています。 Hibernate Searchがイベントリスナを介してインデックスファイルを更新しようとすると、次の例外が発生します。私はこの問題について読んだことがあるが、何も私のために働くようではない。私は本当に助けていただければ幸いです。Hibernate Search ..封印されていない封印されたWorkQueueにアクセスする

環境: 春3.0.5 にHibernate 3.5.4 休止検索3.2.1

例外:

TransactionSy E org.springframework.transaction.support.TransactionSynchronizationUtils invokeAfterCompletion TransactionSynchronization.afterCompletion threw exception 
           org.hibernate.AssertionFailure: Exception releasing cache locks 
at org.hibernate.engine.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:584) 
at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:204) 
at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:594) 
at org.springframework.orm.hibernate3.SpringSessionSynchronization.afterCompletion(SpringSessionSynchronization.java:229) 
at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168) 
at org.springframework.transaction.jta.JtaAfterCompletionSynchronization.afterCompletion(JtaAfterCompletionSynchronization.java:62) 
at com.ibm.ws.uow.ComponentContextSynchronizationWrapper.afterCompletion(ComponentContextSynchronizationWrapper.java:83) 
at com.ibm.tx.jta.RegisteredSyncs.coreDistributeAfter(RegisteredSyncs.java:357) 
at com.ibm.ws.tx.jta.RegisteredSyncs.distributeAfter(RegisteredSyncs.java:317) 
at com.ibm.tx.jta.TransactionImpl.distributeAfter(TransactionImpl.java:2933) 
at com.ibm.tx.jta.TransactionImpl.postCompletion(TransactionImpl.java:2892) 
at com.ibm.tx.jta.TransactionImpl.postCompletion(TransactionImpl.java:2805) 
at com.ibm.tx.jta.TransactionImpl.commitXAResources(TransactionImpl.java:1775) 
at com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:497) 
at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:978) 
at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:913) 
at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:369) 
at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161) 
at com.ibm.ws.uow.UOWManagerImpl.uowCommit(UOWManagerImpl.java:1172) 
at com.ibm.ws.uow.UOWManagerImpl.uowEnd(UOWManagerImpl.java:1142) 
at com.ibm.ws.uow.UOWManagerImpl.runUnderNewUOW(UOWManagerImpl.java:1092) 
at com.ibm.ws.uow.UOWManagerImpl.runUnderUOW(UOWManagerImpl.java:626) 
at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:281) 
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:127) 
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621) 
at com.test.service.inventory.InventoryServiceImpl$$EnhancerByCGLIB$$847cc0d8.updateInventoy(<generated>) 
at com.test.web.servlet.SearchServlet.doPost(SearchServlet.java:51) 
at com.test.web.servlet.SearchServlet.doGet(SearchServlet.java:75) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) 
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449) 
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790) 
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443) 
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175) 
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91) 
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859) 
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557) 
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173) 
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455) 
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384) 
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272) 
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202) 
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766) 
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896) 
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527) 
Caused by: org.hibernate.HibernateException: Error while indexing in Hibernate Search (ater transaction completion) 
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnAfterTx.doAfterTransactionCompletion(EventSourceTransactionContext.java:179) 
at org.hibernate.engine.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:577) 
... 51 more 
Caused by: org.hibernate.annotations.common.AssertionFailure: Access a Sealed WorkQueue which has not been sealed 
at org.hibernate.search.backend.WorkQueue.getSealedQueue(WorkQueue.java:87) 
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.performWorks(BatchedQueueingProcessor.java:280) 
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.afterCompletion(PostTransactionWorkQueueSynchronization.java:96) 
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnAfterTx.doAfterTransactionCompletion(EventSourceTransactionContext.java:176) 
... 52 more 

私は同様の問題の修正があった知っている[#1 HSEARCH-540 ]それは私のために働いていないようです。ここで

は私の春のコンテキストである:ここで

<bean id="sessionFactory" 
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> 
    <property name="dataSource" ref="dataSource" /> 
    <property name="packagesToScan" value="com.test.entity.inventory" /> 
    <property name="hibernateProperties"> 
     <props> 
      <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop> 
      <prop key="hibernate.show_sql">true</prop> 
      <prop key="hibernate.format_sql">true</prop> 
      <prop key="hibernate.jdbc.batch_size">40</prop> 
      <!-- Hibernate Search properties --> 
      <prop key="hibernate.search.default.indexBase">/POC/index</prop> 
      <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop> 

     </props> 
    </property> 
</bean> 

<bean id="transactionManager" 
    class="org.springframework.transaction.jta.WebSphereUowTransactionManager" /> 

<tx:annotation-driven /> 

<bean id="inventoryDao" 
    class="com.test.dao.inventory.InventoryDao"> 
    <property name="sessionFactory" ref="sessionFactory" /> 
</bean> 

が例外をスローして、私のinventoryDao方法です。

 @Transactional 
     public Inventory updateInventoy(long id) { 
    Inventory inv = null; 
       Session session = sessionFactory.getCurrentSession(); 
    inv = (Inventory) session.load(Inventory.class, id); 
    inv.setPrice(100000); 
    inv.setModel("Testing123"); 

     return inv; 
} 

データベースは正常に更新されますが、インデックスは更新されません。

助けてください。事前に感謝..あなたがそうのように、フルテキストセッションであなたのHibernateセッションをラップする必要がデータベースと同期してインデックスを維持するために

+0

これを理解できましたか?私も同じ問題を抱えており、SpringがSessionFactoryを実行する方法はほぼポジティブです。 –

答えて

0

FullTextSession session = Search.getFullTextSession(sessionFactory.getCurrentSession()); 

その後にフルテキストセッションを使用ラップされたセッションの場所。

関連する問題