Project

General

Profile

bug #7702

corrupted hibernate session after previous error during save operation

Added by Andreas Kohlbecker 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Highest
Category:
cdm-vaadin
Target version:
Start date:
08/29/2018
Due date:
% Done:

100%

Severity:
critical
Found in Version:
Tags:

Description

This is the same problem as in #7559

the bug has not 100% been fixed be the changes made last time.

After this NPE

Caused by: java.lang.NullPointerException
        at eu.etaxonomy.cdm.persistence.hibernate.permission.TargetEntityStates.propertyChanged(TargetEntityStates.java:71)
        at eu.etaxonomy.cdm.persistence.hibernate.permission.voter.RegistrationVoter.furtherVotingDescisions(RegistrationVoter.java:55)
        at eu.etaxonomy.cdm.persistence.hibernate.permission.voter.CdmPermissionVoter.vote(CdmPermissionVoter.java:167)
        at eu.etaxonomy.cdm.persistence.hibernate.permission.voter.CdmPermissionVoter.vote(CdmPermissionVoter.java:34)
        at eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable.decide(UnanimousBasedUnrevokable.java:74)
        at eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator.evalPermission(CdmPermissionEvaluator.java:221)
        at eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator.hasPermission(CdmPermissionEvaluator.java:118)
        at eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor.checkPermissions(CdmSecurityHibernateInterceptor.java:206)
        at eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor.onSave(CdmSecurityHibernateInterceptor.java:106)
        at org.hibernate.event.internal.AbstractSaveEventListener.substituteValuesIfNecessary(AbstractSaveEventListener.java:388)
        at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:254)
        at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:178)
        at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)
        at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:38)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)
        at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:32)
        at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
        at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:679)
        at org.hibernate.internal.SessionImpl.save(SessionImpl.java:671)
        at org.hibernate.internal.SessionImpl.save(SessionImpl.java:666)
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.save(CdmEntityDaoBase.java:366)
        at eu.etaxonomy.cdm.api.service.ServiceBase.save(ServiceBase.java:279)
        at eu.etaxonomy.cdm.api.service.RegistrationServiceImpl.assureIsPersisted(RegistrationServiceImpl.java:252)
        at eu.etaxonomy.cdm.api.service.RegistrationServiceImpl.createRegistrationForName(RegistrationServiceImpl.java:235)
        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.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
        at com.sun.proxy.$Proxy644.createRegistrationForName(Unknown Source)
        at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.onDoneWithTaxonnameEditor(RegistrationWorkingsetPresenter.java:482)
        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.vaadin.spring.events.internal.MethodListenerWrapper.publish(MethodListenerWrapper.java:78)
        at org.vaadin.spring.events.internal.ListenerCollection.publish(ListenerCollection.java:167)
        at org.vaadin.spring.events.internal.ScopedEventBus$1.onEvent(ScopedEventBus.java:58)
        at org.vaadin.spring.events.internal.EventBusListenerWrapper.publish(EventBusListenerWrapper.java:55)
        at org.vaadin.spring.events.internal.ListenerCollection.publish(ListenerCollection.java:167)
        at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:116)
        at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:131)
        at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:133)
        at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:121)
        at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor$SaveHandler.postCommit(AbstractPopupEditor.java:360)
        ... 83 more

the session was not cleared, which lead to the probelm

org.hibernate.HibernateException: illegally attempted to associate a proxy with two open Sessions
                at org.hibernate.proxy.AbstractLazyInitializer.setSession(AbstractLazyInitializer.java:107)
                at org.hibernate.engine.internal.StatefulPersistenceContext.reassociateProxy(StatefulPersistenceContext.java:605)
                at org.hibernate.engine.internal.StatefulPersistenceContext.unproxyAndReassociate(StatefulPersistenceContext.java:632)
                at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
                at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:648)
                at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:640)
                at org.hibernate.engine.spi.CascadingActions$5.cascade(CascadingActions.java:218)
                at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:398)
                at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323)
                at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:162)
                at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:111)
                at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:150)
                at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:141)
                at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:74)
                at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
                at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1251)
                at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1767)
                at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:423)
                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.persistence.dao.hibernate.common.CdmEntityDaoBase.load(CdmEntityDaoBase.java:741)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.load(VersionableDaoBase.java:93)
                at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.load(VersionableDaoBase.java:36)
                at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:184)
                at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:42)
                at sun.reflect.GeneratedMethodAccessor2778.invoke(Unknown Source)
                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.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
                at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
                at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
                at com.sun.proxy.$Proxy627.load(Unknown Source)
...


Related issues

Related to Edit - bug #7559: possibly corrupted hiberante session after previous error on saving editor Resolved 07/17/2018

Associated revisions

Revision 0f1cc6a3 (diff)
Added by Andreas Kohlbecker 4 months ago

ref #7702 avoiding NPE in TargetEntityStates when pervious state is null

Revision 7450d44b (diff)
Added by Andreas Kohlbecker 4 months ago

fix #7702 always clearing session in finally clause

History

#1 Updated by Andreas Kohlbecker 4 months ago

  • Subject changed from corrupted hiberante session after previous error during save operation to corrupted hibernate session after previous error during save operation

#2 Updated by Andreas Kohlbecker 4 months ago

  • Related to bug #7559: possibly corrupted hiberante session after previous error on saving editor added

#3 Updated by Andreas Kohlbecker 4 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#4 Updated by Andreas Kohlbecker 3 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 50 to 100

hard to review - time will show - closing ticket

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)