Project

General

Profile

bug #8027

Hibernate fails to obtain transaction-synchronized Session for thread and brings taxeditor in unrecoverable state

Added by Andreas Kohlbecker 5 months ago. Updated about 2 months ago.

Status:
New
Priority:
Highest
Assignee:
Category:
taxeditor
Target version:
Start date:
01/28/2019
Due date:
% Done:

0%

Severity:
major
Found in Version:

Description

Walter reported:

Hallo,

hatte vorhin schon einmal kurzzeitig so ein Aus, jetzt wohl dauerhaft (seit Minuten). Internet läuft. Mist, mitten beim Arbeiten.
Nach Neustart läuft’s aber wieder – nur Eingabe weg

This was caused by Hibernate failing to obtain a transaction-synchronized Session for the current thread

[salvador] 2019-01-26 14:37:48,341 ERROR [qtp1012570586-3113] [eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase] - Opening new session in turn of a HibernateException
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
        at org.springframework.orm.hibernate5.SpringSessionContext.currentSession(SpringSessionContext.java:132)
        at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:697)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase.getSession(DaoBase.java:59)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.getSession(CdmEntityDaoBase.java:267)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:414)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:410)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.findByUuid(VersionableDaoBase.java:67)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.findByUuid(VersionableDaoBase.java:36)
        at eu.etaxonomy.cdm.api.service.ServiceBase.find(ServiceBase.java:148)
        at eu.etaxonomy.cdm.api.service.VersionableServiceBase.isDeletable(VersionableServiceBase.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at com.sun.proxy.$Proxy1828.isDeletable(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:78)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
        at com.sun.proxy.$Proxy2203.isDeletable(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:212)
        at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:39)
        at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
        at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
        at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)
        at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:871)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:213)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:497)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)

picture768-1.png View (13.8 KB) Andreas Kohlbecker, 01/28/2019 12:58 PM

edit-prod_transaction-synchronized-2018-10-26.txt View (44.8 KB) Andreas Kohlbecker, 01/29/2019 02:22 PM

2019-01-26-out-clean.log View (3.2 MB) Andreas Kohlbecker, 01/29/2019 02:22 PM

History

#1 Updated by Andreas Kohlbecker 5 months ago

Can the TaxEditor be made more resilient against these types of problems by catching this exception and trying to re recover from this failure?

#2 Updated by Andreas Müller 5 months ago

  • Assignee changed from Andreas Müller to Katja Luther

Personally I don't think it is a TaxEditor problem. It rather looks like the server had the problem and could not recover. But not sure as I do not have more information. Did the server restart afterwards?

Does anybody know if this happen before? To me it is new. Is it possible to search the log files for previous errors of this type.

#3 Updated by Andreas Kohlbecker 5 months ago

Andreas Müller wrote:

Personally I don't think it is a TaxEditor problem. It rather looks like the server had the problem and could not recover. But not sure as I do not have more information. Did the server restart afterwards?

Does anybody know if this happen before? To me it is new. Is it possible to search the log files for previous errors of this type.

I found 44 occurrences like this in the edit-production log file since 2018-10-26, please find the report attached as edit-prod_transaction-synchronized-2018-10-26.txt

The server did not restart after this incidence. I also don't think that this is a taxeditor problem, it is most probably a problem with hibernate, maybe with the conversation holder. But the taxeditor could be made resilient against this type of problems to avoid the need to restart it.

#4 Updated by Andreas Kohlbecker 5 months ago

I also attached the cleaned log from edit-production for the 2019-01-26 where I found this issue the first time: 2019-01-26-out-clean.log

#5 Updated by Andreas Müller 5 months ago

Andreas Kohlbecker wrote:

I also don't think that this is a taxeditor problem, it is most probably a problem with hibernate, maybe with the conversation holder. But the taxeditor could be made resilient against this type of problems to avoid the need to restart it.

I still do not fully understand. Does it mean that restarting the TaxEditor solves the problem for the client? If yes I wonder how this can be. The TaxEditor only should have short sessions. So no matter if you restart the Editor in between calling the methods. But probably I miss something here.

#6 Updated by Andreas Müller 5 months ago

Maybe we should split the ticket into 1. avoid the hibernate issue and 2. make the client and/or server resilient to such issues.

#7 Updated by Andreas Müller 5 months ago

  • Target version changed from Unassigned CDM tickets to Release 5.6
  • Severity changed from normal to major

As this happened 44 times since October I consider it to be a severe issue. Do you agree to take it to the next version as issue?

#8 Updated by Andreas Kohlbecker 5 months ago

Andreas Müller wrote:

Andreas Kohlbecker wrote:

I also don't think that this is a taxeditor problem, it is most probably a problem with hibernate, maybe with the conversation holder. But the taxeditor could be made resilient against this type of problems to avoid the need to restart it.

I still do not fully understand. Does it mean that restarting the TaxEditor solves the problem for the client? If yes I wonder how this can be. The TaxEditor only should have short sessions. So no matter if you restart the Editor in between calling the methods. But probably I miss something here.

This is how I understood Walter in his email: "Nach Neustart läuft’s aber wieder – nur Eingabe weg" However, I did not try to verify this assumption.

#9 Updated by Katja Luther 4 months ago

  • Priority changed from New to Highest
  • Target version changed from Release 5.6 to Release 5.7

#10 Updated by Katja Luther about 2 months ago

  • Target version changed from Release 5.7 to Release 5.8

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)