bug #5289


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

Added by Katja Luther about 8 years ago. Updated almost 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Found in Version:


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 ....

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

with stacktrace:

login : admin
editor version :
server : localhost / Z350_editor_test
schema version :
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(
    at eu.etaxonomy.taxeditor.model.AbstractUtility$
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(
    at org.eclipse.jface.window.ApplicationWindow$
    at org.eclipse.swt.custom.BusyIndicator.showWhile(
    at org.eclipse.ui.internal.progress.ProgressManager$
    at org.eclipse.swt.custom.BusyIndicator.showWhile(
    at org.eclipse.ui.internal.progress.ProgressManager$
    at org.eclipse.swt.widgets.Synchronizer.syncExec(
    at org.eclipse.ui.internal.UISynchronizer.syncExec(
    at org.eclipse.swt.widgets.Display.syncExec(
    at org.eclipse.ui.internal.progress.ProgressManager.runInUI(
    at eu.etaxonomy.taxeditor.model.AbstractUtility.runInUI(
    at eu.etaxonomy.taxeditor.model.AbstractUtility.executeOperation(
    at eu.etaxonomy.taxeditor.navigation.navigator.handler.DeleteHandler.execute(
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(
    at org.eclipse.core.commands.Command.executeWithChecks(
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(
    at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(
    at org.eclipse.ui.menus.CommandContributionItem.access$19(
    at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(
    at org.eclipse.swt.widgets.EventTable.sendEvent(
    at org.eclipse.swt.widgets.Widget.sendEvent(
    at org.eclipse.swt.widgets.Display.runDeferredEvents(
    at org.eclipse.swt.widgets.Display.readAndDispatch(
    at org.eclipse.ui.internal.Workbench.runEventLoop(
    at org.eclipse.ui.internal.Workbench.runUI(
    at org.eclipse.ui.internal.Workbench.access$4(
    at org.eclipse.ui.internal.Workbench$
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
    at eu.etaxonomy.taxeditor.Application.start(
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
    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(
    at org.eclipse.equinox.launcher.Main.basicRun(
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(
    at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(
    at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(
    at eu.etaxonomy.cdm.api.conversation.ConversationHolder.commit(
    at eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation.postExecute(
    at eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation.execute(
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(
    ... 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(
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(
    at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(
    at org.hibernate.internal.SessionImpl.saveOrUpdate(
    at org.hibernate.engine.spi.CascadingAction$5.cascade(
    at org.hibernate.engine.internal.Cascade.cascadeToOne(
    at org.hibernate.engine.internal.Cascade.cascadeAssociation(
    at org.hibernate.engine.internal.Cascade.cascadeProperty(
    at org.hibernate.engine.internal.Cascade.cascade(
    at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(
    at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(
    at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(
    at org.hibernate.internal.SessionImpl.flush(
    at org.hibernate.internal.SessionImpl.managedFlush(
    at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(
    at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(
    at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(
    ... 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 NavigatorClosedKatja Luther

Actions #1

Updated by Katja Luther almost 8 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.

Actions #2

Updated by Andreas Müller almost 8 years ago

  • Target version deleted (Release 3.12)
Actions #3

Updated by Katja Luther over 7 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.

Actions #4

Updated by Andreas Müller over 7 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?

Actions #5

Updated by Katja Luther over 7 years ago

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

new ticket for refresh of navigator #5670

Actions #6

Updated by Andreas Kohlbecker almost 4 years ago

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

Updated by Andreas Kohlbecker almost 4 years ago

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

Also available in: Atom PDF