New Posts New Posts RSS Feed: EntityManager in a WCF Service
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

EntityManager in a WCF Service

 Post Reply Post Reply
Author
downeytim View Drop Down
Newbie
Newbie


Joined: 08-Dec-2009
Location: Dallas, Texas
Posts: 18
Post Options Post Options   Quote downeytim Quote  Post ReplyReply Direct Link To This Post Topic: EntityManager in a WCF Service
    Posted: 24-May-2011 at 12:30pm
Does anyone have WCF services built using DevForce for data access?  We have several services built and have used the EntityManager in the service.  It seems to be slowing down our services a good deal.  It takes a very long time to instantiate the EntityManager on every call to the service.  Our services are all Per-Call type.

Any examples or help with speeding up the creation of the EM would be greatly appreciated.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 25-May-2011 at 4:12pm
Hi Tim,
 
A few pointers:
 
1) I’d try setting the CompositionHost.SearchPatterns (in your global.asax?)
While this affects initial startup, it wouldn’t necessarily be the cause of problems as each EM is constructed.However, if the list of probed assemblies is large, that might cause later performance issues.
You can read more about discovery/CompositionHost in the DevForce Resource Center.
 
2) Also, have in mind that in n-tier every EM will be doing initialization and handshake logic to talk to the EntityServer, overhead that could be avoided if communication with a BOS on another server is not really necessary.
 
3) Every EM will also try to login before anything else is done with it, so you might want to take a look at your IEntityLoginManager logic.
 
4) Check your debug log. It might show the areas that are taking the longest and help you diagnostic the problem.
Back to Top
downeytim View Drop Down
Newbie
Newbie


Joined: 08-Dec-2009
Location: Dallas, Texas
Posts: 18
Post Options Post Options   Quote downeytim Quote  Post ReplyReply Direct Link To This Post Posted: 14-Jun-2011 at 1:45pm
This helped a great deal.  I cannot stress how important this is.  It reduced the time to intialize an Entity Manager from 20 seconds to 4 seconds.  In a WCF service call a 20 second initialization is obviously not workable.  Even 4 seconds is a very long time to happen on every call to our servic
Back to Top
kpinniger View Drop Down
Newbie
Newbie
Avatar

Joined: 10-Mar-2010
Location: Atlanta, GA USA
Posts: 7
Post Options Post Options   Quote kpinniger Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jul-2011 at 1:12pm
I have a question about this statement:

1) I’d try setting the CompositionHost.SearchPatterns (in your global.asax?)

When does the CompositionHost.SearchPatterns have to be added?  Just before creation of the EM?  We are currently having one bos server two seperate applications and require that each application adds in their own searchpatterns.
 
Any suggestions would be very much appreciated.
 
Kurt Pinniger
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jul-2011 at 2:42pm
Hi Kurt,
 
As per the DRC:
 
You need to set the SearchPatterns and IgnorePatterns as early as possible in your application, since as soon as you use the IdeaBladeConfig.Instance, TraceFns and DebugFns methods, or an EntityManager, initialization will automatically occur.
  • In an EntityServer hosted by IIS or an ASP.NET application, the best place to set the patterns is in the application startup logic in the global.asax.
  • In Silverlight, you should do this in the Application_Startup logic to ensure that your changes are made before probing occurs.
  • In a desktop application, set the patterns before you begin using an EntityManager or other DevForce components.
 
 
You will find more information in the DevForce Resource Center.
 
Kind regards,
   Silvio.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down