Test Datasource Connection Requirements

Version 3

    User Story

     

    A administrative user is logged into Wildfly Web Administrative Console and wants to create a datasource, there is a wizard window to help guide the user to fill in the datasource connection details. At some point in the end, right before saving the datasource, the user wants to test the datasource, to verify if the datasource details are correct and proceed to save it. There should be a button to test it, the result should be either

    • If there is no error, it should present to the user, that the datasource is ok to save.
    • If there is an error, the error message (from the management operation) should be presented to the user and let he/she choose to save it or not.

     

    Previous implementation

     

    The "test datasource" before save was already implemented in HAL (Widlfly Web Console), but had some problems, as the test datasource is provided by a management operation named "test-connection-in-pool" available only as runtime operation for a designated host/server (in domain mode), so it required the datasource to be effectively saved to test it, if the user choose not to save, the datasource was removed. However this caused problems since adding and removing datasources set the reload-status to requires-restart. This made it impossible to create the data source in advance in order to test it and remove it afterwards if the user chose to cancel the wizard.

     

    Implementation

     

    With the implementation of EAP7-577, adding and removing a datasource does no longer set the the reload-status to requires-restart. This makes it possible to re-introduce the old workflow in the create datasource wizard:

     

    1. The user enters all necessary data for the datasource
    2. On the last page the user can test the datasource. This page must provide a help text which describes that in order to test the datasource it will be created in advance. 
      • If the test fails or the user cancels the wizard the datasource will be removed again.
      • If the test succeeds and the user finishes the wizard, the datasource which was created in advanced won't be removed.

     

    Domain Mode

    When running domain mode, testing a datasource is only possible if there's a running server with a matching profile!

     

    Links