Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5169

Saving PersonAttributeType breaks subsequent API calls (with NonUniqueObjectException)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Code Review (Initial)
    • Priority: Must
    • Resolution: Unresolved
    • Affects Version/s: Core 2.1.0
    • Fix Version/s: None
    • Component/s: None
    • Complexity:
      Low

      Description

      Importing PersonAttributeType via a Metadata Sharing package fails on Core 2.1.0.

      See the detailed steps to reproduce: https://talk.openmrs.org/t/error-while-importing-metadata-sharing-package-containing-personattributetypes/11484

      org.openmrs.module.metadatasharing.task.TaskException: Task failed
        at org.openmrs.module.metadatasharing.task.Task.log(Task.java:125)
        at org.openmrs.module.metadatasharing.task.TaskEngine$RunnableTask.run(TaskEngine.java:127)
        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:748)
      Caused by: org.openmrs.module.metadatasharing.task.TaskException: Task failed
        ... 4 more
      Caused by: org.openmrs.module.metadatasharing.task.TaskException: Import failed
      
      [...]
      
      Caused by: org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [org.openmrs.PersonAttributeType#2]
      
      [...]
      

      Full error log

      The bug seems to be related to changes added by this commit, 2b9b2b8, in file PersonServiceImpl, line187

      Also reported here: https://talk.openmrs.org/t/person-attribute-type-move-up-down-throws-error/18481

        Attachments

          Activity

            People

            Assignee:
            samuel34 Samuel Male
            Reporter:
            mksrom Romain Buisson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: