This is another shining example of Microsoft Hiding the problem.In my dealings with Microsoft software / tools, I’ve found that they tend to like to hide the innards of what went wrong whenever they can.There were no events in the Event Viewer, no log-files to speak of, no additional information just an error. Well after some digging through some ILSpy’ed code, I managed to figure out what it was trying to do. The problem is, some Microsoft programmer thought he was so smart, and he put a glorious try/catch around the entire method (presumably to catch any bad SQL errors or strange mishaps that go on). This: The whole problem is they’re throwing a Message DBManager Exception inside the try then wrapping it with another.Ultimately it was trying to execute this SQL against my database: Great right? This effectively hides the one well defined error they DID plan for behind the catch all for the infinite array they didn’t plan for.When all is said and done, it’s not uncommon to duplicate the majority of validations in schema and models.For example: model allows users to register, reset their password, and change their name.The schema for this application tells us that for users to be valid in our domain they must have a name, username, encrypted password, and a related organization.
As we’ve covered previously, some of these application layer validations are insufficient for ensuring database integrity and must be backed with database constraints for this purpose.Unfortunately, this is a closed off piece of code in a proprietary system, and we cannot change this code. What they should do is explicitly catch the Message DBManager Exception and re-throw it so THAT exception gets passed along (since that’s the message it would seem they wanted to communicate to the user, “Hey your DB is wrong!”) If you’re like me, and tinkering with this stuff, it’s possible you used the Retail Database Utility to build yourself a database for your store, and now you’re trying to set up a Retail Store Connect session to link to that database. It’s looking for a that it’ll use to store the synchronization state and intermediate rows.The context eliminates the smell of conditional validations often seen in Active Record models.