[Issue] Failing to Import Charts and Report Tables

Hi,

We are using the latest version of DHIS 2.25 (build - 5e16867).

We have created charts and report tables on data visualiser and pivot table apps respectively. However, metadata import fails for these two objects when we try to sync them from one DHIS instance to another. Please find the logs below.

Failing to Import Charts

  • INFO 2016-11-03 12:15:46,836 (admin) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [http-bio-8080-exec-9])

  • ERROR 2016-11-03 12:15:46,858 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 [http-bio-8080-exec-9])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

Failing to import Pivot Tables

  • INFO 2016-11-03 12:18:55,718 (admin) Creating 1 object(s) of type ReportTable (DefaultObjectBundleService.java [http-bio-8080-exec-10])

  • ERROR 2016-11-03 12:18:55,722 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 [http-bio-8080-exec-10])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

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

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

at com.sun.proxy.$Proxy186.commit(Unknown Source)

at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:116)

at sun.reflect.GeneratedMethodAccessor860.invoke(Unknown Source)

Could you please help fix these issues. They particularly have been persisting since 2.24 onwards.

Cheers,

···

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

Hi Archana

I’m sorry I’ve been trying to reproduce this for a while now, but I have not been able to. Are you importing these into a fresh database? or does it already contain some metadata?

Are you able to share the database/payload where this is happening?

···

On Fri, Nov 4, 2016 at 6:13 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are using the latest version of DHIS 2.25 (build - 5e16867).

We have created charts and report tables on data visualiser and pivot table apps respectively. However, metadata import fails for these two objects when we try to sync them from one DHIS instance to another. Please find the logs below.

Failing to Import Charts

  • INFO 2016-11-03 12:15:46,836 (admin) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [http-bio-8080-exec-9])
  • ERROR 2016-11-03 12:15:46,858 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 [http-bio-8080-exec-9])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

Failing to import Pivot Tables

  • INFO 2016-11-03 12:18:55,718 (admin) Creating 1 object(s) of type ReportTable (DefaultObjectBundleService.java [http-bio-8080-exec-10])
  • ERROR 2016-11-03 12:18:55,722 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 [http-bio-8080-exec-10])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

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

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

at com.sun.proxy.$Proxy186.commit(Unknown Source)

at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:116)

at sun.reflect.GeneratedMethodAccessor860.invoke(Unknown Source)

Could you please help fix these issues. They particularly have been persisting since 2.24 onwards.

Cheers,

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


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

Hi

I think most of these issues should have been resolved now, please try it again…

···

On Mon, Nov 7, 2016 at 8:09 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Archana

I’m sorry I’ve been trying to reproduce this for a while now, but I have not been able to. Are you importing these into a fresh database? or does it already contain some metadata?

Are you able to share the database/payload where this is happening?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Nov 4, 2016 at 6:13 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are using the latest version of DHIS 2.25 (build - 5e16867).

We have created charts and report tables on data visualiser and pivot table apps respectively. However, metadata import fails for these two objects when we try to sync them from one DHIS instance to another. Please find the logs below.

Failing to Import Charts

  • INFO 2016-11-03 12:15:46,836 (admin) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [http-bio-8080-exec-9])
  • ERROR 2016-11-03 12:15:46,858 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 [http-bio-8080-exec-9])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

Failing to import Pivot Tables

  • INFO 2016-11-03 12:18:55,718 (admin) Creating 1 object(s) of type ReportTable (DefaultObjectBundleService.java [http-bio-8080-exec-10])
  • ERROR 2016-11-03 12:18:55,722 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 [http-bio-8080-exec-10])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

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

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

at com.sun.proxy.$Proxy186.commit(Unknown Source)

at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:116)

at sun.reflect.GeneratedMethodAccessor860.invoke(Unknown Source)

Could you please help fix these issues. They particularly have been persisting since 2.24 onwards.

Cheers,

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


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

Hi Morten,

Yes, tried with the latest version again. Charts and Report Tables are now being imported. Thanks!

Cheers,

···

On Mon, Nov 7, 2016 at 1:11 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi

I think most of these issues should have been resolved now, please try it again…

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

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Mon, Nov 7, 2016 at 8:09 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Archana

I’m sorry I’ve been trying to reproduce this for a while now, but I have not been able to. Are you importing these into a fresh database? or does it already contain some metadata?

Are you able to share the database/payload where this is happening?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Fri, Nov 4, 2016 at 6:13 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We are using the latest version of DHIS 2.25 (build - 5e16867).

We have created charts and report tables on data visualiser and pivot table apps respectively. However, metadata import fails for these two objects when we try to sync them from one DHIS instance to another. Please find the logs below.

Failing to Import Charts

  • INFO 2016-11-03 12:15:46,836 (admin) Creating 1 object(s) of type Chart (DefaultObjectBundleService.java [http-bio-8080-exec-9])
  • ERROR 2016-11-03 12:15:46,858 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 [http-bio-8080-exec-9])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

Failing to import Pivot Tables

  • INFO 2016-11-03 12:18:55,718 (admin) Creating 1 object(s) of type ReportTable (DefaultObjectBundleService.java [http-bio-8080-exec-10])
  • ERROR 2016-11-03 12:18:55,722 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 [http-bio-8080-exec-10])

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.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:160)

at sun.reflect.GeneratedMethodAccessor865.invoke(Unknown Source)

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

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

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)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

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

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

at com.sun.proxy.$Proxy186.commit(Unknown Source)

at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:116)

at sun.reflect.GeneratedMethodAccessor860.invoke(Unknown Source)

Could you please help fix these issues. They particularly have been persisting since 2.24 onwards.

Cheers,

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


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