Print Page | Close Window

Datasource Extension issue

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3323
Printed Date: 30-May-2025 at 4:51am


Topic: Datasource Extension issue
Posted By: mitchell_bu
Subject: Datasource Extension issue
Date Posted: 07-Mar-2012 at 3:34pm

We just upgraded our application to 6.1.6.0 and we noticed a major issue.  We take advantage of being able to target different databases dynamically at log-in by defining a datasource extension in the DomainModelEntityManager constructor.  However, after upgrading, it seems as if the extension is being ignored when determing which database to connect to, with the first connection string in our config file always being used.  When debugging, before calling ConnectAsync on the EntityManager, I can see that the DataSourceExtension property is assigned correctly.  We also tried setting the new UseDefaultAuthenticationContext to false, with no effect.

 

Is this a bug or are we overlooking some breaking change??

 
 
UPDATE:
After digging into it a little more, it seems like it may be related to the IEntityLoginManager.  We implement this interface and in the Login method we use the EntityManager parameter that is passed in to create a new DomainModelEntityManager to verify login credentials.  However, the EntityManager that is getting passed in doesn't have the Datasource Extension property set.  I never had reason to get this deep in the code before, but since it worked up until now, I would have to assume that the property was getting passed correctly before 6.1.6.0.



Replies:
Posted By: mitchell_bu
Date Posted: 08-Mar-2012 at 7:00am
Narrowed it down and it may be something we're doing wrong.
 
We've replaced our EntityManager.LoginAsync(credentials) call with Authenticator.Instance.LoginAsync(credentials) since the EntityManager methods are being deprecated.  The problem is that the Authenticator isn't aware of the Datasource Extension value.  Is there some initialization step we're missing?


Posted By: kimj
Date Posted: 08-Mar-2012 at 10:39am
Hi Mitchell,
 
The Authenticator Login and LoginAsync methods also accept a LoginOptions argument, which allows you to specify the data source extension, among other things.   The now deprecated EntityManager.Login methods actually pass LoginOptions based on the EntityManager settings along with its call to the Authenticator.  So that's also what you need to do  - not something you're doing wrong, just something we haven't documented well. 
 


Posted By: mitchell_bu
Date Posted: 08-Mar-2012 at 11:15am
Thanks Kim!



Print Page | Close Window