Project

General

Profile

bug #5289

trying to delete an already deleted object leads to not correctly handled exception

Added by Katja Luther about 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Priority14
Assignee:
Category:
taxeditor
Target version:
Start date:
09/24/2015
Due date:
03/31/2016
% Done:

100%

Severity:
normal
Found in Version:

Description

Errors are now handled by standard error handling, so we can probably close this ticket.

However, when I tried to delete a taxon node which I did delete before in the database (via SQL) I still got an exception which was difficult to read/understand by the user:

An error occurred while executing Delete. null
Please contact EDIT Support ....

Reason:
org.exclipse.core.commands.ExecutionException: While executing the operation, an exception occurred.

with stacktrace:

login : admin
editor version : 3.8.0.201509052203
server : localhost / Z350_editor_test
schema version : 3.6.0.0.201527040000
os : Windows Server 2012 6.2 amd64
java : 1.7.0_75
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
    at eu.etaxonomy.taxeditor.model.AbstractUtility$1.run(AbstractUtility.java:313)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2649)
    at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1346)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.progress.ProgressManager$7.run(ProgressManager.java:1184)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683)
    at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1182)
    at eu.etaxonomy.taxeditor.model.AbstractUtility.runInUI(AbstractUtility.java:491)
    at eu.etaxonomy.taxeditor.model.AbstractUtility.executeOperation(AbstractUtility.java:331)
    at eu.etaxonomy.taxeditor.navigation.navigator.handler.DeleteHandler.execute(DeleteHandler.java:141)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
    at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
    at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
    at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at eu.etaxonomy.taxeditor.Application.start(Application.java:24)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: deleted object would be re-saved by cascade (remove deleted object from associations): [eu.etaxonomy.cdm.model.taxon.Taxon#60]; nested exception is org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [eu.etaxonomy.cdm.model.taxon.Taxon#60]
    at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:169)
    at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:680)
    at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:562)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
    at eu.etaxonomy.cdm.api.conversation.ConversationHolder.commit(ConversationHolder.java:303)
    at eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation.postExecute(AbstractPersistentPostOperation.java:99)
    at eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation.execute(DeleteOperation.java:161)
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
    ... 50 more
Caused by: org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [eu.etaxonomy.cdm.model.taxon.Taxon#60]
    at org.hibernate.internal.SessionImpl.forceFlush(SessionImpl.java:1225)
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:182)
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:114)
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
    at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:727)
    at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:719)
    at org.hibernate.engine.spi.CascadingAction$5.cascade(CascadingAction.java:258)
    at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:387)
    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:330)
    at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)
    at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)
    at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:160)
    at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:151)
    at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)
    at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:402)
    at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
    at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
    at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554)
    ... 56 more

This is problamatic in multiple ways:

  • The first sentence is not good English. If this is due to concatenation we should rather have a line break I guess. NPEs should always be translated to what it is and not using "null".

  • Unexpected exceptions/errors should always be called "unexpected" not only exceptions/errors. If not execpected they should give more detailed information on what happened and how to solve it.

  • We may want to check why a re-save may take place here. Though the data is corrupt in a way, I wouldn't expect resave to happen. But we may also check if this is the same behavior in remoting before spending unnecessary time here.

This ticket was split from #5140


Related issues

Copied to Edit - bug #5670: refresh of Taxon Navigator New 03/31/2016

Associated revisions

History

#1 Updated by Katja Luther about 5 years ago

  • Target version changed from Unassigned CDM tickets to Release 3.12
  • Priority changed from New to Priority14

check whether the delete methods already use only uuids.

before performing the delete check for the existence of the object.

#2 Updated by Andreas Müller almost 5 years ago

  • Target version deleted (Release 3.12)

#3 Updated by Katja Luther over 4 years ago

  • Status changed from New to Resolved
  • Assignee changed from k.luther - to Andreas Müller

delete methods use uuids and before performing the delete it is checked whether the object exists in the db. (r27391)

the messaging for the delete result are already improved.

#4 Updated by Andreas Müller over 4 years ago

  • Assignee changed from Andreas Müller to k.luther -

This ticket can be closed.

However, I do not understand why the message says please close the navigator and reopen. Why do we have a refresh method for the navigator but it never seems to work. Maybe we need a new ticket to again discuss/implement refresh on taxon navigator correctly. Can you please create one?

#5 Updated by Katja Luther over 4 years ago

  • Status changed from Resolved to Closed
  • Resolution set to fixed
  • % Done set to 100

new ticket for refresh of navigator #5670

#6 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)
  • Private changed from Yes to No

#7 Updated by Andreas Kohlbecker about 1 year ago

  • Copied to bug #5670: refresh of Taxon Navigator added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)