EtienneKep wrote:
Hello,
Thanks,
For the first part, here is a code sample which failed :
EntityCollection trades = new EntityCollection(new TradeEntityFactory());
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.TradeEntity);
prefetchPath.Add(TradeEntity.PrefetchPathCustomer);
IRelationPredicateBucket filter = new RelationPredicateBucket();
// The connection string of "Trade" database
// "Customer" table is in a different database (and different server)
DataAccessAdapterBase adapter = new DataAccessAdapter("data source=xxxx;initial catalog=master;integrated security=SSPI;persist security info=False;packet size=4096");
adapter.FetchEntityCollection(trades, filter, prefetchPath);
// ==> When fetching entity, it failed because it cannot reach the "Customer" table
How can I make this loading with 2 connections string ?
I need more info in how your model is spread across catalogs in your project in the designer and in the databases. A connection can only be created to one server at a time. The names of the databases in that server can be rewritten in the query. So you can have catalog A, B and C in your project in the designer (you can add multiple catalogs there) and at runtime you have on server S catalog D, E and F. You can then specify overwrites so A->D, B -> E and C->F, see:
http://www.llblgen.com/documentation/4.1/LLBLGen%20Pro%20RTF/hh_goto.htm#Using%20the%20generated%20code/Adapter/gencode_dataaccessadapter_adapter.htm#Catalogspecificpersistenceinfo
If at runtime it turns out that catalog D is not on S but on on another server T, you can't connect to that catalog when you connect to S. I honestly don't think it is that disconnected, so please provide more information about how the model looks like in practice and when the names of the catalogs change (of they change) from the catalogs used in the project in the designer.
(btw that code snippet uses syntax which is a bit outdated, for fetching queries, please look at QUeryspec or linq)
For the lazy loading, it help to improve performance in GUI, when displaying details on data for example. If we have thousand source lines and want to display details only for 2 lines we don't want to load details for all source lines.
With an adapter we will need to load manually this data. It could be done, but it's easier to use lazy loading.
Ok, good point. That's however not supported at this point.