Print Page | Close Window

Implementing IEntityServerSaved not working for multiple ibedmx models

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4568
Printed Date: 25-Aug-2019 at 8:24am


Topic: Implementing IEntityServerSaved not working for multiple ibedmx models
Posted By: sanselmo
Subject: Implementing IEntityServerSaved not working for multiple ibedmx models
Date Posted: 17-Oct-2013 at 7:51am
Hi,

we have a software that always starts with a "base" ibedmx model. This one the "OnSaving" and "OnSaved" are invoked correctly.

We have other modules that each have their own ibedmx model, loaded on demand. 
Each of those ondemand have their own edmKey in our web.config file.
The "SaveChanges" made on those are not invoking  the "OnSaving" and "OnSaved" methods.

Any advices or things I could try?

Seb



Replies:
Posted By: kimj
Date Posted: 18-Oct-2013 at 8:01am

Probing for an IEntityServerSaving implementation is done once only when an EntityServer starts, and an error is thrown if multiple implementations are found.  So your logic within the handler will need to be non-key specific.

For the record, we urge anyone still using DF2009 to upgrade to DF2010 or DF2012 to receive maintenance and feature updates.


Posted By: sanselmo
Date Posted: 20-Oct-2013 at 6:02pm
I only have one implementation and my implementation code is not key specific (it uses our injected base entity type), so no error thrown.

"Probing for an IEntityServerSaving implementation is done once only when an EntityServer starts"

Does that means that the "first and only" EntityServer initialization will use my implementation, or each "new" entity server init should use it ?



Posted By: kimj
Date Posted: 21-Oct-2013 at 6:57am
If you're using data source key extensions an EntityServer is started for each. Each EntityServer will probe for IEntityServerSaving and other interface implementations.


Posted By: sanselmo
Date Posted: 21-Oct-2013 at 9:26am
I found the source of my problems : LAN vs. WAN

Our platform uses preferably LAN mode, but if not available it will use WAN. 

In development, LAN is always used since the database is LAN reachable (if not even on the same computer!).

I have put my implementation code in a server assembly, but when in LAN, the server (clientside) cannot find the implementation. Now I moved my code in a "shared" assembly thats delivered both on the application AND server: its get called and it works!

I forgot about that DevForce part of LAN/WAN and corresponding EntityServer...

thanks kimj for your support


Posted By: sanselmo
Date Posted: 21-Oct-2013 at 12:30pm
Furthermore, don't forget to put the assembly in the App.config file (for client side LAN EntityServer)



Print Page | Close Window