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

Fix issues with StartModule and context refresh

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Could
    • Resolution: Fixed
    • None
    • OpenMRS 1.9.0
    • Module Engine
    • None
    • 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.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: