You really didn't see that coming?



  •  Like I've mentioned before I'm maintaining a desktop application that uses replication to synchronize its SQL Server CE database with a central server. Apart from the usual synchronization there is also an option to register a new subscription and make a fresh start by downloading a brand new copy of the data from the server. When activated this process works like so:

    1) Rename current sdf (that's the database file).

    2) Create the new sdf with the name of the original sdf

    3) Synchronize

    Once the synchronization has finished, you are immediately working with the new data. Once in a while of course this process might fail; the server isn't responding or is too slow or the SQL Server publication decided to take a day off or a butterfly on the other side of the world is having its period. Regardless the reason, step 3 fails leaving the application with its good database file as a renamed file and an empty database file as the active database. To add insult to injury when that happens the synchronization dialog shows the exception message in a messagebox which is then followed by another messagebox informing us that the synchronization was successfull. And then yours truly has to log in and fix the screwup.

    What really pisses me off is that it would have taken exactly the same amount of effort to build this properly, but the original dev just didn't give a shit. It's not like it'd be him maintaining it.

     



  • Why don't you just change the logic to download the new sdf to a temporary file?  If the download suceeds, start at step one (skipping the download part, of course). If not, show the error message.



  • @frits said:

    Why don't you just change the logic to download the new sdf to a temporary file?  If the download suceeds, start at step one (skipping the download part, of course). If not, show the error message.

    He can't because he's busy fixing the app on users workstations and therefore has no time to update the app



  • @DOA said:

    ... or a butterfly on the other side of the world is having its period...

    That really made me laugh!



  • @ltouroumov said:

    @frits said:

    Why don't you just change the logic to download the new sdf to a temporary file?  If the download suceeds, start at step one (skipping the download part, of course). If not, show the error message.

    He can't because he's busy fixing the app on users workstations and therefore has no time to update the app

    Or if he can't get them to change existing code/workflow: add detection for this scenario and just restore the file.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.