Specifying Multiple Catalogs in Code - Self Servicing

Posts   
 
    
David H
User
Posts: 100
Joined: 31-Dec-2004
# Posted on: 13-Jun-2012 09:04:52   

Is there a way to specify using multiple catalogs in code for self-servicing?

The relevant section in the documentation reads:

Multi-tenancy support is implemented through catalog/schema name overwriting at runtime. This is configurable through code and by definitions in the .config file of your application

What follows describes how to set the .config file.

Could you please elucidate how/if this can be done purely in code?

Thanks

David

P.S. I am using LLBLGEN Pro 3.5 Final May 31, 2012.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 13-Jun-2012 10:04:14   

SelfServicing doesn't support per-call name overwriting, as there's no 'known connection' at any given point. You can only overwrite, in code, globally in selfservicing, which means it's affecting all connections. If you want per-call name overwriting, use adapter, as described in the template group descriptions in the documentation.

Frans Bouma | Lead developer LLBLGen Pro
David H
User
Posts: 100
Joined: 31-Dec-2004
# Posted on: 14-Jun-2012 17:38:19   

Hi Otis,

Good to hear from you.

Indeed, I know that Adapter is required for per-cell overriding.

In the self-servicing application the database is selected for the entire session -- so it is static.

I implemented this using the suggested change in the configuration, where Kamino is the name of the original database.


    <configSections>
        <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler" />
    </configSections>
    <sqlServerCatalogNameOverwrites>
        <add key="Kamino" value="" />
    </sqlServerCatalogNameOverwrites>

My question is: can this be done in code instead of in .config.

Thanks

David

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Jun-2012 19:49:40   

What you have in the config file neutralizes the caalog name, so it will depend on the catalog name in the connectionString used. Which canbe globally set by using the following:

CommonDaoBase.ActualConnectionString = "....";