dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #43735
Modifying Data Sets throws exception during Metadata Import
Hi Morten,
We are using two instances of DHIS2 both running on version 2.23. We have a
sample metadata setup on one of the instances and the same imported into
the other. But, the import fails whenever, we are making any changes to an
existing data set - like, adding a new data element to it, or changing its
period type, or changing the org. units it is assigned to. Is this a known
issue?
Here are the logs generated for the exception:
INFO 2016-03-04 17:13:02,507 Building object-bridge maps took 0.25
seconds. (DefaultObjectBridge.java [taskScheduler-2])
* WARN 2016-03-04 17:13:02,507 Can not find getter for 'oAuth2Clients'.
(DefaultImportService.java [taskScheduler-2])
* INFO 2016-03-04 17:13:02,507 Importing 1 DataElements
(DefaultImportService.java [taskScheduler-2])
* INFO 2016-03-04 17:13:02,513 Importing 1 DataSets
(DefaultImportService.java [taskScheduler-2])
*org.hibernate.TransientObjectException: object references an unsaved
transient instance - save the transient instance before flushing:
org.hisp.dhis.period.PeriodType*
at
org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:249)
at org.hibernate.type.EntityType.getIdentifier(EntityType.java:536)
at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:311)
at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:321)
at org.hibernate.type.TypeHelper.findDirty(TypeHelper.java:294)
at
org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:4049)
at
org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:537)
at
org.hibernate.event.internal.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:235)
at
org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:164)
at
org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:230)
at
org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:100)
at
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:61)
at
org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1166)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1616)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374)
at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:396)
at
org.hisp.dhis.hibernate.HibernateGenericStore.getObject(HibernateGenericStore.java:303)
...
...
...
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
** ERROR 2016-03-04 17:13:02,519 Exception happened while trying to do
meta data sync object references an unsaved transient instance - save the
transient instance before flushing: org.hisp.dhis.period.PeriodType
(MetadataSyncTask.java [taskScheduler-2])*
org.hisp.dhis.dxf2.metadata.sync.exception.MetadataSyncServiceException:
object references an unsaved transient instance - save the transient
instance before flushing: org.hisp.dhis.period.PeriodType
at
org.hisp.dhis.dxf2.metadata.sync.DefaultMetadataSyncService.doMetadataSync(DefaultMetadataSyncService.java:147)
at
org.hisp.dhis.dxf2.metadata.tasks.MetadataSyncTask.runSyncTask(MetadataSyncTask.java:215)
at
org.hisp.dhis.dxf2.metadata.tasks.MetadataSyncTask.access$000(MetadataSyncTask.java:43)
at
org.hisp.dhis.dxf2.metadata.tasks.MetadataSyncTask$1.doWithRetry(MetadataSyncTask.java:120)
at
org.hisp.dhis.dxf2.metadata.tasks.MetadataSyncTask$1.doWithRetry(MetadataSyncTask.java:116)
at
org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:263)
at
org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:168)
at
org.hisp.dhis.dxf2.metadata.tasks.MetadataSyncTask.run(MetadataSyncTask.java:115)
at org.hisp.dhis.scheduling.ScheduledTasks.run(ScheduledTasks.java:60)
*Any help would be appreciated.*
Thanks,
Archana Chillala
Application Developer
Email archanac@xxxxxxxxxxxxxxxx
Telephone +91 9100960533 <+91+9100960533>
[image: ThoughtWorks]
<http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>