New Posts New Posts RSS Feed: EntityManager and specifying EntityConnection
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

EntityManager and specifying EntityConnection

 Post Reply Post Reply
Author
MickyG View Drop Down
Newbie
Newbie
Avatar

Joined: 06-Jun-2010
Location: UK
Posts: 2
Post Options Post Options   Quote MickyG Quote  Post ReplyReply Direct Link To This Post Topic: EntityManager and specifying EntityConnection
    Posted: 08-Jun-2010 at 3:54am
Thanks Greg, I have just this minute read the Dev Force with Ado.Net entity framework whitepaper and found the bit on the DataSourceKey extension.
 
Cheers
Mike
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 07-Jun-2010 at 3:33pm
Three overloads of the EntityManager constructor take a DataSourceExtension parameter which will direct retrievals and saves to a specific instance of the database against whose schema a given entity was defined.  See the material on DataSourceKeys, DataSourceExtension, and DataSourceKeyResolvers in the Business Object Persistence_Advanced topic documents, and in the sample solutions at

     Learning Resources\040_BusObjPersistence\DataSourceKeys


Edited by GregD - 07-Jun-2010 at 3:33pm
Back to Top
MickyG View Drop Down
Newbie
Newbie
Avatar

Joined: 06-Jun-2010
Location: UK
Posts: 2
Post Options Post Options   Quote MickyG Quote  Post ReplyReply Direct Link To This Post Posted: 06-Jun-2010 at 4:36am
I would like set the EntityConnection of my EntityManager.
How do I do that?

What I am trying to achieve, is I have a Windows service that hosts different worker threads. All the threads do not necessary point to the same database. Currently I am able to set the connection string on a thread by thread bases. I have a DevForce model and am trying to achieve the same thing, but because it inherits from EntityManager and EntityManager does not take a EntityConnection as part of the constructor I am struggling to figure out how I do this.

Any advice would be greatly appreciated.

Cheers
Mike
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down