StrataFrame Forum

DDT Data Deployment Error

http://forum.strataframe.net/Topic6700.aspx

By Tim Dol - 2/11/2007

I wrote a database installer DLL to deploy the role based security files, based on the installer example on the forum. (DataProgress)

In my AppMain I added some code to check if the security database exists. If not, I automatically call the installer DLL.

Everything works perfectly when I run my application within visual studio, however, When I run the exe, I get the attached error.  The error occurs at the start of the data deployment phase.  The meta data is deployed without errors.

Any idea why this is happening?

Thanks

Tim

By Tim Dol - 2/11/2007

I took the sample installer project on the forum to see if the same issue exists. I changed the package name  and password to match my deployment package.

Everything worked fine when I ran the project from within visual studio, however when I ran the exe the same error popped up.

Tim

By StrataFrame Team - 2/12/2007

I have no idea why you would be getting this error at runtime and not design-time.  All of the foreign keys on the tables within the database are disabled before the data is deployed and then re-enabled after the data deployment has completed.

It is possible that this could be a timing issue between the runtime versions and the debug version through Visual Studio.  Are you waiting until the completed event has been fired after deploying the meta-data before you call DeployData()?

By Tim Dol - 2/12/2007

Yes, the StartDataDeploymentPhase() is called after the buildcomplete event is fired.
By StrataFrame Team - 2/13/2007

The only thing I can think to tell you is to make sure that the foreign keys are actually being turned off... since you're building the SF source code in debug, you can open the DatabaseMigrator file within the MicroFour StrataFrame DBEngine project and add a message box to the TurnOffAllForeignKeys() method to show the value of the DatabaseName parameter.  When you run, you should then get the message boxes for each database that is being included in the deployment.  If a database isn't included, then the foreign keys aren't being turned off and we have a problem somewhere.
By Tim Dol - 2/14/2007

Ben, I haven't had time to dig into this any further but I have run my deployment routine about 20 times so far and it seems to be hit and miss, sometime it works and sometimes I get the error.  After the error, I delete the Database and run the deployment again and it works fine.  Just thought I would pass this on in case it triggers something.

Thanks,

Tim