Issues with Replication and Update Files in Orixa 

Orixa Apps can be run in a "Replication" mode, where different users can add an edit data without being connected to a central database server.
After a period of time adding data to their own local computer, the user can then "Run Updates", to merge all their new data and changes to the main database.
In some situations when the user calls "Run Updates" an update file may be generated which cannot be merged into the main database. The possible reasons for this are complex. For example, a new field might have been added to a table on the main database, meaning that the user's update file was no longer compatible with the main database.

To cope with these issues an Update Management Utility has been created. It can only be run on the main database computer (server), and allows the Orixa Administrator to generate a manual Update file, and run this step by step to add data, correcting SQL where necessary to allow the updates to merge with the main database.

Accessing the Update Management Utility

Running the Orixa Update Management Utility  

  1. Navigate to the "OrxUpdateUtility.exe" on your Server, and double-click to run.

Update management utility: Select a database  

  1. As soon as the Utility starts, you will be prompted to select an Orixa Database Connection.
  2. Click on the down arrow to open the list, and pick the connection you want to connect to from the list.
  3. Click "Go" to connect to this database.

 

Update Management Utility User Interface  

  1. Main Menu button. Click here to access actions to fix your database updates.
  2. Menu: Retrieve Update Data, Generate Update File, View Update SQL File options (explained below)
  3. Title area, showing details of the database you are connected to.
  4. Pick list for Stores in your database in which update files may be present.
  5. Pick list for Update Files. This list will update once you have picked a Store from the previous pick-list.
  6. Output FileName. Once the utlity has completed it's work, this will display the name of the resulting file.

 

Update Management Utility showing update-records and details  

  1. The user has clicked "Retrieve Update Data" after selecting a Store and UPD FileName.
  2. All the Updates generated by the user and stored in the Update File have been converted into viewable data. This data can be reviewed and checked. Each row shows a single Update, Insert or Delete statement.
  3. The details of each statement can be viewed in the "RowData" field. Double-click to open details showing the field-by-field details of data changes made by the user.

NOTE: At this stage, when you have the update data present in the data-grid it is possible to manually review and update the data if you wish to. A manual review can also be done once the update file has been generated. If running the update has generated an error which includes useful details such as the ID of a problematic record, at this stage it is possible to find a particular ID in the data-grid and review these rows of update data to review the cause of the issue in detail.

Update Maagement Utility - Generate Update File  

  1. Once you are happy with the data in the data-grid, click on the Main Menu button, and click "Generate Update File". The Utility will generate the file and ask you to give it a file name, where it will be saved to disk.
    Please allow about 20 - 30 seconds per 1,000 rows of data for the utility to generate the update file. If the update file contains many thousands of rows, it may take some time. 

 

Update Management Utility - Update File Generated  

  1. Once the process is complete, you will be prompted to save the resulting update-data into a SQL File. This file can then be opened in the Database Management Utility and used to merge the update file while checking row-by-row that the updates are correctly formatted.

 

Editing the Update File in the DB Utility  

  1. In your main Orixa DB Utility (on the server computer)
  2. Load the SQL file created in the Update Utility.
  3. The many update-statements generated by the Utility will then be shown.

How to use the Update File generated by the Utility

Each individual section of the update file is separated by an exclamation mark.

The Administrator should review statements and correct them. For example if a particular ID is referenced in the Update file, but is no longer present on the main server, this value can be edited to allow it to update correctly. If a field has been added, removed or renamed within a table, the administrator can search and replace for these items in the SQL, which should then run correctly.

As the DB Utility runs each SQL Statement it will be high-lighted in turn. If any statement generates an error it will not run. The Administrator can review the statement that generated the error, and edit it as needed to allow it to run successfully.