﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Database Deployment Toolkit » Issues  » Error after successful deployment</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 21:29:40 GMT</lastBuildDate><ttl>20</ttl><item><title>Error after successful deployment</title><link>http://forum.strataframe.net/FindPost17771.aspx</link><description>This is from the end of the deployment log:&lt;br&gt;
&lt;br&gt;
• 7/10/2008 2:00:39 PM	-&gt; Finished verifying databases on server.&lt;br&gt;
• 7/10/2008 2:00:39 PM	-&gt; Executing Post-Deployment Scripts&lt;br&gt;
• 7/10/2008 2:00:39 PM	-&gt; Executing Post-Deployment Scripts - Complete&lt;br&gt;
• 7/10/2008 2:00:39 PM	-&gt; The meta data conversion to the SQL Server has been completed.&lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt; An error occurred while deploying the data to the server.&lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt; InvalidOperationException        &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;   The connection was not closed. The connection's current state is open.        &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;         &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt; Source     : System.Data        &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;         &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt; Stack Trace:         &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;    at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)        &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;    at System.Data.SqlClient.SqlConnection.Open()        &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;    at MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.DeployDataThread()        &lt;br&gt;
X 7/10/2008 2:00:39 PM	-&gt;         &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Notice it was successful.  I'm using the dataprogress.vb form class from the demo source for database installer sample.  I'm guessing something is not getting cleaned up properly but I'm not sure what.&lt;br&gt;
&lt;br&gt;
My code that calls the form is thus:&lt;br&gt;
&lt;br&gt;
     ' Update database&lt;br&gt;
     Dim loData As New DataProgress()&lt;br&gt;
&lt;br&gt;
     ''-- Show and install database changes&lt;br&gt;
     dr = loData.ShowDialog()&lt;br&gt;
     loData.Close()&lt;br&gt;
     loData.Dispose()&lt;br&gt;
&lt;br&gt;
I added the code to close and dispose the progress form so that I could delete the package file.  Unfortunately, I'm not sure if this is where the problem started...</description><pubDate>Tue, 02 Dec 2008 15:08:29 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost20969.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;I like the idea of another variable, it makes sense. Anyways&amp;nbsp;I guess I will find out on the next release how that does :).Thanks again for the help and ideas.</description><pubDate>Tue, 02 Dec 2008 15:08:29 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost20959.aspx</link><description>Well, this is all threaded.&amp;nbsp; So it is possible that you are running into a threading type of issue.&amp;nbsp; One thing to consider is a Threading.Thread.Sleep(NNN) after the dispose and prior to re-creating the object.&amp;nbsp; If you have a machine that you can reproduce this on, that is where I would start testing.&amp;nbsp; So get it in a reproducable state, then start playing with timing issues to at least see if that is your issue.&amp;nbsp; If it is, then you can remove the Sleep and take a better approach depending on your code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One other idea that I had was to create a nother variable for each phase altogather.&amp;nbsp; So you would have one for the meta-data and another for the data.&amp;nbsp; This is just an idea, but I would imagine that it would resolve the issue as well.</description><pubDate>Tue, 02 Dec 2008 10:00:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost20948.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;Hope you had a&amp;nbsp;good&amp;nbsp;Thanksgiving and time off, I am disposing and recreating the class as follows. I do not get the error consisently (of course never get it on my dev machine) just ocasionally on all different machines and if&amp;nbsp;I rerun the deployment on the machine that errors it works without a problem. It is possible&amp;nbsp;I have a version issue or something as&amp;nbsp; I made the dispose&amp;nbsp;change after reading this post&amp;nbsp;so the problem children might be running old software. Last week was a short week and&amp;nbsp;I was in hurry to get out for opening day of duck&amp;nbsp;season and I released several new things at all at once so I probably missed updating something. Anyway's I will see if the issue persists and if so&amp;nbsp;I will try to narrow it down a bit better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT size=2&gt;[codesnippet]&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' This event indicates that the meta-data portion has been completed&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;/summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;param name="e"&amp;gt;&amp;lt;/param&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _DatabaseSetup_BuildComplete(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; _DatabaseSetup.BuildComplete&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;'-- Dispose and recreate the Migrator instance&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;_DatabaseSetup.Dispose()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;'-- Re-Create the DatabaseMigrator instance&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; AppMain.C_SQLUserName.Length = 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;_DatabaseSetup = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; DatabaseMigrator(AppMain.C_SQLServer, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Else&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;_DatabaseSetup = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; DatabaseMigrator(AppMain.C_SQLServer, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, AppMain.C_SQLUserName, AppMain.C_SQLPassword)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;'-- Starts the data deployment portion of the install&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;StartDataDeploymentPhase()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&amp;nbsp;</description><pubDate>Mon, 01 Dec 2008 16:27:36 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost20937.aspx</link><description>Yeah, I reproduced this and it should fix the issue if you dispose and recreate the object between deployment phases.&amp;nbsp; When you say, "Dispose()" are you re-created the object.&amp;nbsp; Also, to prove this, create a test that only does the second part and skips the first to prove that it is the instance issue or if you are fighting something else.</description><pubDate>Mon, 01 Dec 2008 09:58:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost20891.aspx</link><description>Hi Guys,&lt;/P&gt;&lt;P&gt;I'm running into this issue as well, I am disposing of the database migrator class and still get the issue when trying to run a second deployment, any ideas ?</description><pubDate>Tue, 25 Nov 2008 08:58:59 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost17813.aspx</link><description>[quote]P.S. Looking forward to meeting you guys next week and learning lots of good stuff. [/quote]&lt;/P&gt;&lt;P&gt;We look forward to meeting you as well...it will be nice putting some faces with names :)</description><pubDate>Sat, 12 Jul 2008 09:38:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost17804.aspx</link><description>Yep, it was the data deployment.   I haven't fixed the code yet but these 2 tables are not actually needed just yet so I just removed them from the package for now to test and that got rid of the error.&lt;br&gt;
&lt;br&gt;
Thanks again,&lt;br&gt;
Randy&lt;br&gt;
&lt;br&gt;
P.S. Looking forward to meeting you guys next week and learning lots of good stuff.</description><pubDate>Fri, 11 Jul 2008 13:27:35 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost17786.aspx</link><description>Ah, good thought.  I am deploying data and I didn't even check to see if the data from my 2 tables was successfully deployed. My guess is I won't see any data in those tables since this just shows metadata was successful, I bet you're right, it's trying to deploy the data next and that's where it blows up.  I'll take a look in the morning and let you know.&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Thu, 10 Jul 2008 20:07:33 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Error after successful deployment</title><link>http://forum.strataframe.net/FindPost17772.aspx</link><description>One thing I would look at is if you are deploying both structures and data, re-create the DatabaseMigrator class between the two to see if the error goes away.&amp;nbsp; That would ensure that the connection is closed and re-opened.&amp;nbsp; That would be the first thing that I would look at.</description><pubDate>Thu, 10 Jul 2008 14:01:18 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>