Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #587 (closed)

Opened 17 years ago

Closed 14 years ago

Deleting an Image without deleting Pixels throws confusing exceptin

Reported by: jamoore Owned by: jamoore
Priority: minor Milestone: OMERO-Beta4.2.1
Component: Documentation Version: 3.0-Beta1
Keywords: exceptions Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2010-08-26 (15)

Description

If an Image has a default Pixels (pixels.setDefaultPixels(Boolean.TRUE)) then trying to delete that Image without first deleting the Pixels (which requires deleting the ChannelInfos, etc.) throws the following:

ome.conditions.InternalException:  Wrapped Exception: (org.springframework.dao.InvalidDataAccessApiUsageException):
deleted object would be re-saved by cascade (remove deleted object from associations): [ome.model.core.Image#734]; nested exception is org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [ome.model.core.Image#734]
	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:648)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:408)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
	at org.springframework.orm.hibernate3.HibernateTemplate.flush(HibernateTemplate.java:799)
	at ome.logic.UpdateImpl.afterUpdate(UpdateImpl.java:261)
	at ome.logic.UpdateImpl.doAction(UpdateImpl.java:272)
	at ome.logic.UpdateImpl.deleteObject(UpdateImpl.java:205)

This is not easy to understand.

Change History (4)

comment:1 Changed 14 years ago by jmoore

  • Type changed from User Story to Task

comment:2 Changed 14 years ago by jmoore

  • Milestone changed from Unscheduled to OMERO-Beta4.2.1
  • Remaining Time set to 0.25

comment:3 Changed 14 years ago by jmoore

  • Sprint set to 2010-08-26 (15)
  • Status changed from new to assigned

Plan to throw a more sensible exception, perhaps mentioning IDelete. Existence of the IUpdate.deleteObject method will be reviewed as part of #2656 - API Evolution.

comment:4 Changed 14 years ago by jmoore

  • Remaining Time changed from 0.25 to 0
  • Resolution set to fixed
  • Status changed from assigned to closed

(In [7975]) Catching InvalidDataAccessApiUsageException from deleteObject (Fix #587)

Note: this seems to have been corrected with the newer Hibernate
version (#1260) Now a ValidationException is thrown.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.67795 sec.)

We're Hiring!