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

PatientWorkflowState.toString should not hit the database

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.3.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      While running tests for HTMLFormEntry, when one runs only the tests for EnrollProgramTagTest (rather than the full suite), all of the tests which attempt to modify entities in the database fail with org.hibernate.AssertionFailure: null id in org.openmrs.PatientState entry (don't flush the Session after an exception occurs).

      The failure occurs because of a log statement which logs the entity in AuditableInterceptor. This log statement ends up calling org.openmrs.ProgramWorkflowState.toString, which calls Concept.getName(), which apparently triggers a Hibernate flush. Hibernate gets mad that it's being flushed while it's trying to save an entity.

        Attachments

          Activity

            People

            Assignee:
            bistenes Brandon Istenes
            Reporter:
            bistenes Brandon Istenes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: