← Back to team overview

dhis2-devs team mailing list archive

Re: [Bug 799620] [NEW] Cascade exception when deleting data element category combo

 

Hi Morten,

Let me guess after the spcified category combo which is deleted then GUI
does not show it again?

Second, if checking in *categorycombos_optioncombos* table between* category
combo* and *category option combos*. Then I guess the thing that you could
see in that table is relationship of category combo (the deleted one) and
category option combos which are still there. Its mean they are not removed
completely. Even *cacade *property is set to "all" in the hibernate mapping
of *DataElementCategoryCombo.hbm.xml*.

I also told to Lars about this problem for long time ago but he couldn't
reprocedure this bug at that time.

Please checkout the attached file and hope it could help you in somehow or
just a reference. This patch might not suitable in trunk at the time being
bcoz it's been written down so long...

On Mon, Jun 20, 2011 at 2:34 PM, Morten Olav Hansen
<mortenoh@xxxxxxxxx>wrote:

> Public bug reported:
>
> When deleting a data element category combo, an exception is thrown.
>
> Caused by: org.springframework.dao.InvalidDataAccessApiUsageException:
> deleted object would be re-saved by cascade (remove deleted object from
> associations):
> [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697];
> nested exception is org.hibernate.ObjectDeletedException: deleted object
> would be re-saved by cascade (remove deleted object from associations):
> [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697]
>
> ** Affects: dhis2
>     Importance: Undecided
>         Status: New
>
> ** Description changed:
>
> - When delete a data element category combo, an exception is thrown.
> + When deleting a data element category combo, an exception is thrown.
>
> -
> - Caused by: org.springframework.dao.InvalidDataAccessApiUsageException:
> deleted object would be re-saved by cascade (remove deleted object from
> associations):
> [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697]; nested
> exception is org.hibernate.ObjectDeletedException: deleted object would be
> re-saved by cascade (remove deleted object from associations):
> [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697]
> + Caused by: org.springframework.dao.InvalidDataAccessApiUsageException:
> + deleted object would be re-saved by cascade (remove deleted object from
> + associations):
> + [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697];
> + nested exception is org.hibernate.ObjectDeletedException: deleted object
> + would be re-saved by cascade (remove deleted object from associations):
> + [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697]
>
> --
> You received this bug notification because you are a member of DHIS 2
> India Developers, which is subscribed to DHIS.
> https://bugs.launchpad.net/bugs/799620
>
> Title:
>  Cascade exception when deleting data element category combo
>
> Status in DHIS 2 - District Health Information Software:
>  New
>
> Bug description:
>  When deleting a data element category combo, an exception is thrown.
>
>  Caused by: org.springframework.dao.InvalidDataAccessApiUsageException:
>  deleted object would be re-saved by cascade (remove deleted object
>  from associations):
>  [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697];
>  nested exception is org.hibernate.ObjectDeletedException: deleted
>  object would be re-saved by cascade (remove deleted object from
>  associations):
>  [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697]
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dhis2/+bug/799620/+subscriptions
>


-- 
Good heath !


** Attachment added: "hieu_delete_catecombo_working.diff"
   https://bugs.launchpad.net/bugs/799620/+attachment/2175627/+files/hieu_delete_catecombo_working.diff

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/799620

Title:
  Cascade exception when deleting data element category combo

Status in DHIS 2 - District Health Information Software:
  New

Bug description:
  When deleting a data element category combo, an exception is thrown.

  Caused by: org.springframework.dao.InvalidDataAccessApiUsageException:
  deleted object would be re-saved by cascade (remove deleted object
  from associations):
  [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697];
  nested exception is org.hibernate.ObjectDeletedException: deleted
  object would be re-saved by cascade (remove deleted object from
  associations):
  [org.hisp.dhis.dataelement.DataElementCategoryOptionCombo#1148697]

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/799620/+subscriptions


References