Ticket S136591
Visible to All Users

DBUpdater - Make it possible to provide a notification during the database update

created 14 years ago

Hi Guys,
one thing i woul really need is the ability to send an feedback back to the database updater during and DB Update. Currently in some of my main modules from time to time i have to make some long going database updates, and so in the UpdateDatabaseAfterUpdateSchema there are plenty of methods which executes some stuff if version <= XX. The Problem is that the DBUpdater does not show anything visually whats going on currently, so i would like to show some kind of 43% of XY done…

Show previous comments (1)
Dennis Garavsky (DevExpress) 14 years ago

    Hello,
    Thank you for the update. There is already the following code in the DatabaseUpdater class:

    C#
    private void RaiseProgressEvent(ModuleUpdater moduleUpdater, DBUpdatePhase dbUpdatePhase) { ModuleBase moduleBase_ = null; if(moduleUpdater != null) { foreach(ModuleBase moduleBase in modules) { if(moduleUpdater.GetType().Assembly == moduleBase.GetType().Assembly) { moduleBase_ = moduleBase; } } } if(Progress != null) { Progress(this, new ProgressEventArgs(moduleBase_, dbUpdatePhase)); } }

    and the Progress event is used internally to update the splash screen. However, this event may be not good for "i would like to show some kind of 43% of XY done…".
    In order to achieve this, we can introduce a method into the ModuleUpdater class that will allow you to inform users about the progress more accurately:

    C#
    void OnUpdateProgress(ProgressEventArgs args);

    The event arguments can be similar to http://msdn.microsoft.com/en-us/library/system.management.progresseventargs(v=vs.80).aspx or simpler, against your business requirements.
    What do you think?
    Thanks,
    Dennis

    M M
    Martin Praxmarer - DevExpress MVP 14 years ago

      Hi Dennis,
      thx - i have already seen the progess event - but i need to use that in the DBUpdater scenario. Think of the scenario then the dbupdater is started via command line(or in my case, i have an small win app which starts the update process) - here i need to display the current progress. So similar to the Progress event, there should be an additional event in the DatabaseUpdater class where i can report the status of the current running process. It can be somthing like system.management.progresseventargs, or also like LongOperationProgressChangedEventArgs, providing an percentage, message and data.
      Would be very helpful!
      thx
      Noxe

      Dennis Garavsky (DevExpress) 14 years ago

        Hello Noxe,
        Thank you for the feedback. We will consider it, and possibly implement it in future versions of the suite. Please let me know if you need any additional clarification.
        See Also:
        DBUpdater - Remove an application splash screen showing during the database update
        Thanks,
        Dennis

        Answers

        created 12 years ago (modified 12 years ago)

        I have implemented this suggestion in 12.2. Starting with this version you can call the static DevExpress.ExpressApp.Utils.ApplicationStatusUpdater.Notify method from your ModuleUpdater class to provide additional information about the database update, e.g.:

        C#
        ApplicationStatusUpdater.Notify("CreateReports", "Creating reports in the database...");

        You can also handle the ApplicationStatusUpdater.UpdateStatus event in your code to be notified of any status updates or to correct messages accompanying these status updates.
        To demonstrate this further, I have attached a screenshot of the DBUpdater run output.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.