この問題は、同時要求の負荷が非常に高い瞬間に、実稼働サーバーで時々発生します (そう考えますが、確かではありません)。残念ながら、デバッグ用に再現することはできません...ご覧のとおりOpenSessionInViewFilter
、フィルターチェーンで使用しています。DAO、注釈なし。
SpringSource Jira issues https://jira.springsource.org/browse/SPR-3693でこの効果について読みましたが、Spring バージョン3.1.2.RELEASEを使用しているため、これははるかに修正されたバグのようです。
このケースを再現または修正する方法についてのアイデアをいただければ幸いです。
トランザクションの定義は特別なものではありません (ただし、エラーは で発生しますgetTransaction
):
DefaultTransactionDefinition td = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
td.setIsolationLevel(TransactionDefinition.ISOLATION_DEFAULT);
TransactionStatus status = transactionManager.getTransaction(td);
エラー スタックの原因:
java.lang.IllegalStateException: No value for key [org.hibernate.impl.SessionFactoryImpl@1ff8c2a] bound to thread ["http-apr-83"-exec-3]
at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:209)
at org.springframework.orm.hibernate3.SpringSessionSynchronization.suspend(SpringSessionSynchronization.java:115)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.doSuspendSynchronization(AbstractPlatformTransactionManager.java:666)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.suspend(AbstractPlatformTransactionManager.java:569)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:363)
at com.havilog.baltic.cheetah.services.RtMovementsServiceImpl.moveDone(RtMovementsServiceImpl.java:867)
at sun.reflect.GeneratedMethodAccessor798.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)
at org.apache.wicket.proxy.$Proxy8.moveDone(Unknown Source)
at com.havilog.baltic.cheetah.rf.visual.pages.movements.refill.EnterQuantity.setLocationQty(EnterQuantity.java:378)
at sun.reflect.GeneratedMethodAccessor820.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1185)
at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:641)
at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:143)
at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:186)
at org.apache.wicket.Component.setDefaultModelObject(Component.java:3068)
at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1498)
at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1059)
at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:221)
at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:192)
at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:273)
at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:261)
at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:244)
at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:388)
at org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1763)
at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1728)
at org.apache.wicket.markup.html.form.Form.process(Form.java:900)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:757)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:692)
at sun.reflect.GeneratedMethodAccessor374.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1714)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)