Programatically changing database for BO's & application


Author
Message
JKelly
JKelly
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 19, Visits: 149
Hello,

I have a deployed winform ap with ~ 50 bo's that I am now maintaining. Among the modifications needed are schema changes so I have (of course) a dev environment and DB. The thing is, when I go from one env to the other (dev to prod) I just can not figure out how to do it w/o changing the "Database Name" property for each bo.

I've changed the values in Appmain & Appconfig as well as the db value in the conn string for the project in the bo mapper as well as all of the database properties in each of the designer files but nothing "sticks" - when ever the bo mapper is run the db property is reset to the prior value.

Having to use the bo mapper to remap each bo each time I move from dev to production is a huge time sink. Is there a way around this that I am just not seeing?

Tx - J

    Public Overrides ReadOnly Property Database() As String
        Get
            Return "CommitPayments"
        End Get
    End Property

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
First, let me understand the problem.  The name of the database to which your BOs are mapped is a different name that the name of the database when the product is running in product mode.  Is this correct?  If so, what is the purpose of this (so I can better help you come up with a solution).
JKelly
JKelly
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 19, Visits: 149
Thanks.

Take 2 environments (arbitrarily) 

    Development DB Name: Inventory_dev

    Procution DB Name: Inventory

I develop, test and proof on Inventory_dev. Any sysobjects changes are summed into a script file. Application changes are made, tested and proofed. New binary is created.

Prerelease: Restore a production copy of db to Inventory_stage, apply db change script, install new ap, test

Release: During downtime (maintenance period), I isolate the system (drop any users and lock), Apply DB scripts, install new ap, test

With this model I have to change the bo mapping for the DB property for each bo (which kind of invalidates my testing) in order move from dev to stage to production.

Normally I would use a centalized, externally configurable conn string but with SF I just can't seem to get that model to work.

There has got to be a better way to do this & still use SF - where am I missing the boat?

Tx - J

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I think your problem is actually your connection string.  Just FYI, the database property is actually no longer used within the framework itself.  The only time the database name is used is during the mapping process.  But the connection string is where the the database name is determined.

If you are using the connection string wizard, and you are on the same computer, this might be your problem.  Because your application key is the same so it may be pulling the development connection instead of the production connection.  How are you setting up your connections?  Are you using the AddRequiredDataSourceItem or just manually setting the connection string in the DataSources collection?

You will find this in you AppMain.vb or program.cs file.

Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Trent,

I have a similar issue.  First a little about our environment, were using an Oracle backend.  The way we have our environment configured is such that we have one database and multiple schemas (a schema for dev, one for system, integ, etc.)  The issue were having is we can connect to dev just fine but when we try to deploy to the test environment we can't connect to the proper (integ) database.  We've changed the connection string appropriately to reflect the change, but when we run the app in the new environment we get errors about missing tables.

After a bit of digging we noticed that the BO's are using their DataBase field to prepend any generated call to the database.  The problem with that for us is in Oracle when it prepends the DataBase name then it is in effect acting as the schema name.  So we end up hard coding and compiling the schema name into our app.  Thats a big problem.

Everything would work if SF was not prepending the table name with the DataBase field.  How can we address this?

Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Need to ammend my previous post.  It looks like the sql that gets built is using the TableSchema field, not DataBase.

Either way What I really need to be able to do is have these fields use values from my datasource supplied via DataLayer.DataSources.Add() or something simular.  As it is it's compiling the schema names into the app which isn't going to work.

thanks


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
As I mentioned in our email session, and you discovered, the Database property is not used.  Also, Oracle is the only DB that you really run into this since the DB name changes on SQL but the schema will remain the same.  At any rate, we are aware of this and are looking into a simple solution.  Thanks. Smile
Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Trent,



How's this coming, you guys close to a solution?



Thanks
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