Synchronizing data between catalogs.

Posts   
 
    
PatrickD
User
Posts: 65
Joined: 05-Sep-2006
# Posted on: 21-Mar-2007 09:30:51   

Hi,

I have the following situation: I have an assembly containing logic that performs some complex calculation. This assembly references a Data Access Layer generated by LLBLGen Pro.

The case is that the assembly for calculation is used in two applications with each application having its own catalog. These two catalogs contain the same tables used in the calculations. Lets call these catalogs DatabaseA and DatabaseB

My problem is the following: I am developing a service that synchronizes the contents of these tables between the two catalogs. I want to make use of the same DAL as the two applications. However, as the DAL has been generated from DatabaseA, this DAL explicitly references DatabaseA, e.g.

INSERT INTO [DatabaseA].[dbo].[TableA] ...

In my application that uses DatabaseB, I redirect to DatabaseB by using <sqlServerCatalogNameOverwrites> in the app.config. In the synchronizing service, this solution is not possible as it must read and write data in both databases.

My question boils down to this: Can I programmatically change the catalog name used in queries or maybe remove it at all, thereby using the catalog as specified in the connection string?

Thanks,

Patrick

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 21-Mar-2007 11:33:00   

In selfservicing, that's not possible (programmatically). What you could do is indeed switch off the catalog name, by setting the overwrite from DatabaseA to "".

You then first connect to database A, read the data, then connect to database B and write the data.

Frans Bouma | Lead developer LLBLGen Pro
PatrickD
User
Posts: 65
Joined: 05-Sep-2006
# Posted on: 21-Mar-2007 11:54:42   

Otis wrote:

What you could do is indeed switch off the catalog name, by setting the overwrite from DatabaseA to "".

You then first connect to database A, read the data, then connect to database B and write the data.

That did the trick! Thanks smile