Issue while importing Charts/Tables

Hi,

We are working on DHIS 2.24 branch (revision - 23565). We have created a chart on one DHIS instance and imported it into another DHIS instance. All the other metadata entities sync well, except for charts. The same happens with Pivot Tables, Event reports and Event Charts and maps as well. The importer throws an error and fails at importing these Analytics objects.

Here’s the log trace for the exception -

  • INFO 2016-08-16 18:04:12,673 Skipping unknown property ‘date’. (DefaultRenderService.java [taskScheduler-2])

  • INFO 2016-08-16 18:04:12,674 (system-process) Import:Start (DefaultMetadataImportService.java [taskScheduler-2])

  • INFO 2016-08-16 18:04:12,693 (system-process) Import:Preheat[REFERENCE] took 0.02 seconds (DefaultPreheatService.java [taskScheduler-2])

  • INFO 2016-08-16 18:04:12,694 (system-process) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-2])

  • ** INFO 2016-08-16 18:04:12,694 (system-process) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-2])**

* ERROR 2016-08-16 18:04:12,697 Exception occurred while trying to import the metadata. object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement (MetadataSyncImportHandler.java [taskScheduler-2])

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement

at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279)

at org.hibernate.type.EntityType.getIdentifier(EntityType.java:455)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:281)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:291)

at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:296)

at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4126)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)

at org.hisp.dhis.dxf2.metadata2.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:155)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

This issue was reported earlier, but looks like it has not been fixed. Could you please help fix this.

Cheers,

···

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

Hi,

I’ve tried the same scenario as stated above with DHIS 2.24 (revision - 23578). Still facing the same issue. Any thoughts on this.

regards,
Sayan Bisui

···

On Wed, Aug 17, 2016 at 11:34 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are working on DHIS 2.24 branch (revision - 23565). We have created a chart on one DHIS instance and imported it into another DHIS instance. All the other metadata entities sync well, except for charts. The same happens with Pivot Tables, Event reports and Event Charts and maps as well. The importer throws an error and fails at importing these Analytics objects.

Here’s the log trace for the exception -

  • INFO 2016-08-16 18:04:12,673 Skipping unknown property ‘date’. (DefaultRenderService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,674 (system-process) Import:Start (DefaultMetadataImportService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,693 (system-process) Import:Preheat[REFERENCE] took 0.02 seconds (DefaultPreheatService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,694 (system-process) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-2])
  • ** INFO 2016-08-16 18:04:12,694 (system-process) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-2])**

* ERROR 2016-08-16 18:04:12,697 Exception occurred while trying to import the metadata. object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement (MetadataSyncImportHandler.java [taskScheduler-2])

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement

at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279)

at org.hibernate.type.EntityType.getIdentifier(EntityType.java:455)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:281)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:291)

at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:296)

at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4126)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)

at org.hisp.dhis.dxf2.metadata2.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:155)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

This issue was reported earlier, but looks like it has not been fixed. Could you please help fix this.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

Hi

Can you give me the exact payload where this is happening?

···

On Fri, Aug 26, 2016 at 2:08 PM, Sayan Bisui sayanbi@thoughtworks.com wrote:

Hi,

I’ve tried the same scenario as stated above with DHIS 2.24 (revision - 23578). Still facing the same issue. Any thoughts on this.

regards,
Sayan Bisui


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Aug 17, 2016 at 11:34 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are working on DHIS 2.24 branch (revision - 23565). We have created a chart on one DHIS instance and imported it into another DHIS instance. All the other metadata entities sync well, except for charts. The same happens with Pivot Tables, Event reports and Event Charts and maps as well. The importer throws an error and fails at importing these Analytics objects.

Here’s the log trace for the exception -

  • INFO 2016-08-16 18:04:12,673 Skipping unknown property ‘date’. (DefaultRenderService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,674 (system-process) Import:Start (DefaultMetadataImportService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,693 (system-process) Import:Preheat[REFERENCE] took 0.02 seconds (DefaultPreheatService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,694 (system-process) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-2])
  • ** INFO 2016-08-16 18:04:12,694 (system-process) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-2])**

* ERROR 2016-08-16 18:04:12,697 Exception occurred while trying to import the metadata. object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement (MetadataSyncImportHandler.java [taskScheduler-2])

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement

at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279)

at org.hibernate.type.EntityType.getIdentifier(EntityType.java:455)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:281)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:291)

at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:296)

at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4126)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)

at org.hisp.dhis.dxf2.metadata2.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:155)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

This issue was reported earlier, but looks like it has not been fixed. Could you please help fix this.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

Hi Morten,

Please find the payload attached.

Thanks,
Sayan

payload.json (6.65 KB)

···

On Fri, Aug 26, 2016 at 1:35 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Can you give me the exact payload where this is happening?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Aug 26, 2016 at 2:08 PM, Sayan Bisui sayanbi@thoughtworks.com wrote:

Hi,

I’ve tried the same scenario as stated above with DHIS 2.24 (revision - 23578). Still facing the same issue. Any thoughts on this.

regards,
Sayan Bisui


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Aug 17, 2016 at 11:34 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are working on DHIS 2.24 branch (revision - 23565). We have created a chart on one DHIS instance and imported it into another DHIS instance. All the other metadata entities sync well, except for charts. The same happens with Pivot Tables, Event reports and Event Charts and maps as well. The importer throws an error and fails at importing these Analytics objects.

Here’s the log trace for the exception -

  • INFO 2016-08-16 18:04:12,673 Skipping unknown property ‘date’. (DefaultRenderService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,674 (system-process) Import:Start (DefaultMetadataImportService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,693 (system-process) Import:Preheat[REFERENCE] took 0.02 seconds (DefaultPreheatService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,694 (system-process) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-2])
  • ** INFO 2016-08-16 18:04:12,694 (system-process) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-2])**

* ERROR 2016-08-16 18:04:12,697 Exception occurred while trying to import the metadata. object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement (MetadataSyncImportHandler.java [taskScheduler-2])

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement

at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279)

at org.hibernate.type.EntityType.getIdentifier(EntityType.java:455)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:281)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:291)

at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:296)

at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4126)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)

at org.hisp.dhis.dxf2.metadata2.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:155)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

This issue was reported earlier, but looks like it has not been fixed. Could you please help fix this.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

Hi all,

we have checked that this issue is still present. It can be verified easily in demo server. For example, a reportTable retrieved as

GET https://play.dhis2.org/demo/api/25/metadata?reportTables:filter=id:eq:tWg9OiyV7mu

and later imported as

POST https://play.dhis2.org/demo/api/25/metadata

fails at importation.

This issue prevents from importing reportTables, and as a consequence it also prevents from using metadata sync functionality… Any insights on this?

Thank you!

Víctor

···

On 26 August 2016 at 11:29, Sayan Bisui sayanbi@thoughtworks.com wrote:

Hi Morten,

Please find the payload attached.

Thanks,
Sayan


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Fri, Aug 26, 2016 at 1:35 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Can you give me the exact payload where this is happening?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Aug 26, 2016 at 2:08 PM, Sayan Bisui sayanbi@thoughtworks.com wrote:

Hi,

I’ve tried the same scenario as stated above with DHIS 2.24 (revision - 23578). Still facing the same issue. Any thoughts on this.

regards,
Sayan Bisui


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Wed, Aug 17, 2016 at 11:34 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are working on DHIS 2.24 branch (revision - 23565). We have created a chart on one DHIS instance and imported it into another DHIS instance. All the other metadata entities sync well, except for charts. The same happens with Pivot Tables, Event reports and Event Charts and maps as well. The importer throws an error and fails at importing these Analytics objects.

Here’s the log trace for the exception -

  • INFO 2016-08-16 18:04:12,673 Skipping unknown property ‘date’. (DefaultRenderService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,674 (system-process) Import:Start (DefaultMetadataImportService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,693 (system-process) Import:Preheat[REFERENCE] took 0.02 seconds (DefaultPreheatService.java [taskScheduler-2])
  • INFO 2016-08-16 18:04:12,694 (system-process) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-2])
  • ** INFO 2016-08-16 18:04:12,694 (system-process) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-2])**

* ERROR 2016-08-16 18:04:12,697 Exception occurred while trying to import the metadata. object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement (MetadataSyncImportHandler.java [taskScheduler-2])

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.dataelement.DataElement

at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279)

at org.hibernate.type.EntityType.getIdentifier(EntityType.java:455)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:281)

at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:291)

at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:296)

at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4126)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:528)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:215)

at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:142)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216)

at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)

at org.hisp.dhis.dxf2.metadata2.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:155)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

This issue was reported earlier, but looks like it has not been fixed. Could you please help fix this.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks