Multiple Databases on Different Database Servers

Posts   
 
    
lbluser
User
Posts: 14
Joined: 18-Apr-2008
# Posted on: 11-Jun-2008 11:59:28   

Hi I have the following scenario for my application.

I have a single project (Web application) which interacts with 3 databases on different database servers.

For Example

3 Databases "DB1", "DB2" and "DB3".

"DB1" resides on the Database Server "Server A". (on network) "DB2" resides on the Database Server "Server B". (on network) "DB3" resides on the Database Server "Server C". (on network)

"DB1" contains a table "Table1" "DB2" contains a table "Table2" "DB3" contains a table "Table3"

I want to fetch data from "Table1", "Table2" and "Table3" by joining them on some criteria. Similarly I want to save/update data in these tables in the same transaction. How can i acheive this goal using Adapter service?

Thanks

lbluser

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 11-Jun-2008 12:44:58   

If you want to JOIN between these tables, then you would need to use one server or simulate that you are using one database server. This can be done by using a linked server for each of the external databases.

Then you can do the fetches and Joins as if you are dealing with one database server.

And when it comes to updates on different servers, you may use different DataAccessAdapters, one for each database, and use system transaction or a com+ transaction to execute Updates/Inserts on these databases.

lbluser
User
Posts: 14
Joined: 18-Apr-2008
# Posted on: 30-Jun-2008 15:54:01   

Hi, Thanks for the reply. I have established Linker server but,

  1. How will I get DB2,DB3 catalogs in the same Project(DB1 project). Since designer shows databases of the server instance "Server A" only not of the Linked servers. So the primary question is how to add different catalogs from different servers in the same project.

  2. Or, I am on the wrong track. simple_smile

Please, let me know how to get through this. I couldn't find more help regarding this.

Any level of detail is much appreciated.

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 30-Jun-2008 17:58:28   

You need to create synonyms or views in the main catalog for tables of the linked servers.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 01-Jul-2008 10:28:39   

It still will be difficult, because there's just 1 connection, and meta-data retrieval from linked servers isn't supported (as it's impossible in most cases). Queries targeting linked servers also have to have longer names for tables, which isn't supported. Multi-catalog llblgen pro projects are for catalogs on the same server. Not about catalogs on different machines.

Frans Bouma | Lead developer LLBLGen Pro
lbluser
User
Posts: 14
Joined: 18-Apr-2008
# Posted on: 22-Apr-2009 14:03:37   

okez.