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
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
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
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.