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…
DBUpdater - Make it possible to provide a notification during the database update
Answers
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.
Reviewed by DevExpress Team at 17.02.2011 ?
Hello,
Thank you for the update. There is already the following code in the DatabaseUpdater class:
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:
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
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
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