New Posts New Posts RSS Feed: Multiple EntityManagers & DefaultManager
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Multiple EntityManagers & DefaultManager

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

Joined: 29-Jul-2010
Location: ZA
Posts: 28
Post Options Post Options   Quote pompomJuice Quote  Post ReplyReply Direct Link To This Post Topic: Multiple EntityManagers & DefaultManager
    Posted: 26-Nov-2010 at 5:00am

I have been working on a application that only has one entity manager. When I attempted to add another one (something that should be relatively easy) everything went Nuclear! My assumption that GetDefaultEntityManager was some sort of a attempted singleton pattern was way off. I don't even know why it has a generic parameter, it does not seem to use it O_o?

 

What is the intended usage pattern for working with multiple entity managers? If you look at the code everything just seems wrong. Entity Manager defines the following property in the base class:

public static EntityManager DefaultManager { get; set; }

But then it goes and generates this:

/// <summary>Gets the default manager. </summary>
public new static IdentityEntityManager DefaultManager
{
   
get { return GetDefaultEntityManager<IdentityEntityManager>(); }
}

Now it looks correct, but GetDefaultEntityManager just fetches the very first entitymanger you worked with regardless of the generic paramter specified. I have searched the forum, noone is complaining so that leads me to believe I am missing something.
 
Should I have just instantiated my entity managers explicitly somewhere in my code with a proper singleton pattern from the getgo? Or is there a way in which I can recover without having to go through all my code and rip out all the references to DefaultManager. This is not cool.
 
DevForce is such a phenomenal piece of software, but every now and again you get these weird and blatently broken pieces of functionality that makes no sense. How can you code something like DevForce but get such basic things wrong!?


Edited by pompomJuice - 26-Nov-2010 at 5:05am
Back to Top
pompomJuice View Drop Down
Newbie
Newbie
Avatar

Joined: 29-Jul-2010
Location: ZA
Posts: 28
Post Options Post Options   Quote pompomJuice Quote  Post ReplyReply Direct Link To This Post Posted: 10-Dec-2010 at 1:56am
I eventually solved this by implementing my entitymanagers as singletons and avoiding the use of DefaultManager.
 
Works fine.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down