HattrickOrganizer icon indicating copy to clipboard operation
HattrickOrganizer copied to clipboard

decide how to deal with dbupdater raising an exception during database upgrade

Open akasolace opened this issue 5 years ago • 4 comments

@wsbrenk I agree. This is not directly link to this specific commit but we need to have a common approach for this. I mean which process if dbupdater raise an exception. This should be a ticket we need to discuss at some point ...

Originally posted by @akasolace in https://github.com/akasolace/HO/pull/604

akasolace avatar Jun 21 '20 18:06 akasolace

if there is a possibility to save the database (backup) before starting the update i would suggest to do it and rollback to it whenever any inner update routine fails (throws an exception).

adding or changing colums etc. should throw exception when not successful. the new version can not work without it. removing columns should not throw exception when not successful, since the new version can work with it.

wsbrenk avatar Jun 21 '20 18:06 wsbrenk

if there is a possibility to save the database (backup) before starting the update

I think this is done automatically

rollback to it whenever any inner update routine fails (throws an exception).

this should be feasible

akasolace avatar Jun 21 '20 19:06 akasolace

adding or changing colums etc. should throw exception when not successful. the new version can not work without it. removing columns should not throw exception when not successful, since the new version can work with it.

I agree with that

akasolace avatar Jun 21 '20 19:06 akasolace

found UserTransaction. Would that be a good idea to handle that. additionally we need some message box when the updates tooks a longer time

wsbrenk avatar Jul 03 '20 20:07 wsbrenk