Uploaded image for project: 'JOC - JS7 Operations Center'
  1. JOC - JS7 Operations Center
  2. JOC-2206

Use DBMS server time for timestamps

    XMLWordPrintable

Details

    • Feature
    • Status: Released (View Workflow)
    • Medium
    • Resolution: Fixed
    • 2.0.0
    • 2.9.0
    • None
    • None

    Description

      Current Situation

      • JS7 database tables include a number of timestamp columns such as CREATED, MODIFIED that hold the currrent time. in the UTC time zone.
      • The JOC Cockpit populates timestamps from the instance's local time. The time might be wrong and it might be different from parallel JOC Cockpit instances that are used to update objects and database tables.
      • This implies that we cannot rely on the fact that the sequence of timestamps in the database is correct.

      Desired Behavior

      • All timestamps are created from the database server's time. The time might be rigth or wrong, however it is the same time used by all JOC Cockpit instances and guarantees the correct sequence of timestamps.
      • Java annotations will be used across JOC Cockpit classes to populate timestamps from the database server's time.

      Maintainer Note

      • All JS7 Hibernate database entity classes using CREATED, MODIFIED fields have been updated to use auto-generated UTC timestamps from the corresponding database servers.
      • Technical details
        • Before:
          • Manual programmatic setting was required:
            entity.setCreated(new java.util.Date()), entity.setModified(new java.util.Date())
            • The current JOC server UTC time was used.
        • Now:
          • No entity.setCreated(...) or entity.setModified(...) methods are provided anymore.
          • On each INSERT or UPDATE, such fields are automatically generated using the database server's UTC time.
          • This results in a MODIFIED field that is always updated, independent of whether one "forgot" to manually call entity.setModified(...) during an update operation.

      Test Instructions

      • JOC operation should be tested with all supported databases: MySQL, MSSQL, Oracle, H2, and PostgreSQL.
      • As this change affects almost all JS7 database-based areas, the following should be tested:
        • Starting with DASHBOARD using different filters such as "Today", "Last hour", Run Services (Cleanup, Daily Plan), etc.
        • And all other areas (MONITOR, DAILYPLAN, etc.) using different time-based filters.
      • The joc.log should be checked for any database-related problems.

      Attachments

        Issue Links

          Activity

            People

              re Robert Ehrlich
              ap Andreas Püschel
              Rajdeep Singh Thakur Rajdeep Singh Thakur
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: