Wait for each database to finish deployment before moving to next database


Author
Message
Marcel Heitlager
Marcel Heitlager
StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)StrataFrame User (164 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
Hi,

I modified the sample data installer to try to update multiple databases.  I loop through DbeApplicationData and dbeConnectionsData to retrieve the database names and update the databases.

How can I pause the loop until a database finishes updating before moving on to the next?

<snippet>
     Do
       '-- do some stuff here.
       '-- then get to actual migration.

                            '-- Create the DatabaseMigrator instance
                            If _SQLUserName.Length = 0 Then
                                _DatabaseSetup = New DatabaseMigrator(connections.cs_server, True, Me, connections.cs_username, connections.cs_password)
                            Else
                                _DatabaseSetup = New DatabaseMigrator(_SQLServer, False, Me, connections.cs_username, connections.cs_password)
                            End If
 
                            '-- Begin the deployment of the meta-data (does not include the data in this phase)
                            _DatabaseSetup.DeployMetaData(_PackagePath & "\AES_AWAPPM.pkg", "", laDTNames)

'---I NEED TO PAUSE IT HERE TO WAIT FOR UPDATE TO FINISH BEFORE MOVING ON.

       Loop While connections.MoveNext()
</snippet>

I looked at the _DatabaseSetup_BuildComplete event.  But how can I tie that in to make it wait?


Thanks,

Marcel
Tags
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Marcel.

Maybe you could create a Private List/Array in you class to store your ServerNames and a Private Integer to serve as an index later to hold the current index.
In your loop, you only build your List.
You can put your DatabaseMigrator call into a Sub using the current Index, which was started with 0.
After you go through your loop building your DB list, you can make the first call to the sub where you put your call to the DeployMetaData.
Create the BuildComplete event Handler and in it increase your index on 1 and recall the same sub, which will now get your second DB name and so on, until you go through them all.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search