Reset H2 Database

Last modified by Danniar Firdausy on 2024/09/19 10:17

eMagiz runtimes may contain H2 databases. These databases might need to be wiped clean. This microlearning will guide you through the process of resetting such H2 databases and will also inform you on the considerations that are important before resetting.

Should you have any questions, please get in touch with academy@emagiz.com.

1. Prerequisites

  • Intermediate knowledge of the eMagiz platform

2. Key concepts

This microlearning centers on the reset of a H2 database. The key aspects are:

  • When to use the H2 reset option.
  • How to perform a H2 reset.
  • Implications of resetting the H2 database.

3. H2 Database reset

A reset of the H2 database is used when the database is not performing as expected. This can be because it is retaining the information it is supposed to deliver. It can also be that the database has been unstable and is therefore not performing correctly.

3.1 Cloud

In short, the reset of a H2 database is described below.

  • The reset of the H2 database does the following:
    • Removes the H2 databases that are registered under the standard eMagiz data folder.
    • Re-adds the removed H2 databases.
  • With a reset, you start with a clean slate.
    • H2 databases are emptied.

release-217-template-tango-remove-h2.png

To execute this action please navigate to Deploy -> Architecture. After you have done so you can access the context menu of a particular runtime (via a right mouse click), while in "Start Editing" mode, and select the option called "Reset H2". By pressing this button you execute all steps mentioned above. It is possible to press the 'Reset H2' button for all cloud runtimes, it will however only have an effect if a H2 database exists for the runtime.

3.2 On-premise

When the H2 database of an on-premise runtime needs to be reset the action needed is different. Here, the only action needed is to reset the runtime. This is because the H2 database is stored inside the container when running on-premise instead of in EFS as it is in the cloud.

For more information on resetting a runtime, please check out the following microlearning:

3.3 Implications

Resetting a database has implications. It will remove and re-add all H2 databases on the runtime you have selected. Therefore, all data, which are most likely functional messages, in the databases will be lost. This should be taken into account before deciding to reset a H2 database.

4. Key takeaways

  • The 'Reset H2' button empties all registered H2 databases within the default eMagiz data folder.
  • The 'Reset H2' button is only used for cloud runtimes, for on-premise runtimes a reset of the runtime is needed.
  • Using the reset button will empty all runtime related H2 databases. Therefore, the messages in the database will be lost.

5. Suggested Additional Readings

If you are interested in this topic and want more information on it please read the following microlearnings: