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

Make system ID generation safe by modifying algorithm

    XMLWordPrintable

    Details

    • Complexity:
      Undetermined
    • Development:

      Description

      TODO: this algorithm will fail if someone deletes a user that is not the last one.
      File: /api/src/main/java/org/openmrs/api/db/hibernate/HibernateUserDAO.java
      Line: 390
      Patch:

      Index: api/src/main/java/org/openmrs/api/db/hibernate/HibernateUserDAO.java
      ===================================================================
      — api/src/main/java/org/openmrs/api/db/hibernate/HibernateUserDAO.java (revision 26806)
      +++ api/src/main/java/org/openmrs/api/db/hibernate/HibernateUserDAO.java (working copy)
      @@ -388,6 +388,7 @@
      public Integer generateSystemId() {

      // TODO this algorithm will fail if someone deletes a user that is not the last one.
      + // Issue was added: https://tickets.openmrs.org/browse/TRUNK-3252

      String sql = "select count(user_id) as user_id from users";

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                lluismf Lluis Martinez
                Reporter:
                nullakilla Anton Alekseiev
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 30 minutes
                    30m