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

Fix issues with StartModule and context refresh

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: OpenMRS 1.9.0
    • Component/s: Module Engine
    • Labels:
      None
    • Complexity:
      Medium

      Description

      When @StartModule is added to the PatientServiceTest class, it is resulting in some of the tests failing, for example:
      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.openmrs.Patient.identifiers, no session or session was closed.

      The issue seems to be related to the way the spring context is refreshed in StartModuleExecutionListener
      There might be a cleaner way to do it

      To Reproduce, simply add @StartModule to the start of the class, using any module (e.g. xstream). Run the tests in this class to see the errors.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abbas Abbas Hachem
                Reporter:
                abbas Abbas Hachem
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: