New Posts New Posts RSS Feed: Query Includes Trigger Relation Link Exception
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Query Includes Trigger Relation Link Exception

 Post Reply Post Reply Page  12>
Author
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Topic: Query Includes Trigger Relation Link Exception
    Posted: 10-Jun-2010 at 6:25pm
Ok, we've released a DevForce 6.0.3.1 build that fixes this.  Thanks for the help!
Back to Top
ksmith View Drop Down
Newbie
Newbie
Avatar

Joined: 26-May-2010
Posts: 7
Post Options Post Options   Quote ksmith Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jun-2010 at 7:28am

This works! I had to do what kimj said as well for it to work. Also, I'm now able to run the application in Release mode and over HTTPS. Great work. Thank you.

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 09-Jun-2010 at 6:53pm
Just an addendum to Ting's last post - make sure that you also link the file containing the partial class into your Silverlight domain model project, since the change is needed in both the Silverlight application and the BOS.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 09-Jun-2010 at 3:53pm
Ok I think we have a solution for the Release Build problem.  It appears that the static fields on the EntityRelations class do not initialize in a Release Build if there is no static constructor.
 
The workaround is to define a partial class that defines a static constructor:

  public partial class EntityRelations {

    static EntityRelations() { }

  }

 

If you confirm that this also works for you, we will issue a patch for it.

 

 

Back to Top
ksmith View Drop Down
Newbie
Newbie
Avatar

Joined: 26-May-2010
Posts: 7
Post Options Post Options   Quote ksmith Quote  Post ReplyReply Direct Link To This Post Posted: 08-Jun-2010 at 12:01pm
One last thing to look into...
 
I also ran into a problem testing the application over SSL. I noticed in the DevForce log file that the EntityService.svc starts up with an HTTPS URL but the EntityServer starts up over HTTP when the following in used in the Global.asax file:

System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider()); 

The Silverlight (SL) client could not communicate with the EntityServer over SSL.
 
I deployed to Windows Server 2008 RC 2, IIS 7.5, with an SSL cert installed and accessed the SL client over HTTPS.
 
Thanks
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 07-Jun-2010 at 2:56pm

Thanks for the additional research.  This will help us nail it down.

Back to Top
ksmith View Drop Down
Newbie
Newbie
Avatar

Joined: 26-May-2010
Posts: 7
Post Options Post Options   Quote ksmith Quote  Post ReplyReply Direct Link To This Post Posted: 04-Jun-2010 at 8:02pm
Finally figured it out. I built the sample application in Release mode and experienced the same problem. I then deployed my application after building it in Debug mode and this problem did not occur. The problem happens when the application is built in Release mode on both Windows 7 and Windows Server 2008. You should be able to duplicate it now.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 04-Jun-2010 at 3:24pm
I believe we have seen asssembly probing issues when both DevForce and raw Entity Framework models are in the same deployment.  We're looking into this.
 
 
Back to Top
ksmith View Drop Down
Newbie
Newbie
Avatar

Joined: 26-May-2010
Posts: 7
Post Options Post Options   Quote ksmith Quote  Post ReplyReply Direct Link To This Post Posted: 04-Jun-2010 at 8:24am
I modified a DevForce sample application to display both customers and orders (using the Include() method) and then deployed it to the server and it worked. Therefore, the problem is specific to my application only. From the EDM, I am generating both the DevForce Entity classes and the EF classes although they are in different namespaces. I plan on refactoring my code to use just the DevForce generated classes. I tried step 1 and that did not work. The log file shows an error probing my domain model assembly where the generated classes reside. I haven't been able to get the probing to work when DevForce starts up.
 
At least I know now that the problem is app specific and not related to the deployment environment.
 
Thank you again for all of your help.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 03-Jun-2010 at 5:33pm
Two more things:
 
1)  In the global.asax, try adding:
  IdeaBlade.EntityModel.EntityRelation.InitializeEntityRelations(typeof(FieldServiceReport).Assembly);
 
2)  Take a look at the server-side debuglog.xml to see if there are any unusual errors there.
 
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 02-Jun-2010 at 6:31pm
Thanks for trying that out.  We will try to reproduce this on our end.
Back to Top
ksmith View Drop Down
Newbie
Newbie
Avatar

Joined: 26-May-2010
Posts: 7
Post Options Post Options   Quote ksmith Quote  Post ReplyReply Direct Link To This Post Posted: 02-Jun-2010 at 3:41pm
I built a Windows Server 2008 RC machine. Added the IIS and Web Server Roles and then installed the .Net Framework 4 on the machine. I marked all of the assemblies in my web project as Copy Local including the assemblies for IdeaBlade 6.0.2 and the Entity Framework assemblies and deployed the solution to the application folder on the server (I followed the deployment instructions in the IdeaBlade Deployment guide). Still the same error. Again, everthing works locally on Windows 7 using the same database that the application is using on the server. Have you tried deploying an application that Windows Server 2008 RC that uses a .Include() in a query? Queries that do not use a .Include() are working on this new server.
 
Thank you for your help.
 
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 28-May-2010 at 3:56pm

Definitely confirm that all the assemblies are deployed into the bin folders and not in the GAC.  We found a similar support case and that turned out to be the problem.

Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 27-May-2010 at 6:47pm
Ok, the code seems pretty normal.
 
This feels like an assembly mismatch error.  Here are a few things to double check:
1)  Confirm the correct files are on the server.  (I'm sure you've done this already...)
2)  Make sure all the projects are targeted at the .NET 4.0 Framework.
3)  Check that DevForce is not installed on the machine, and there are no DevForce assemblies in the GAC or elsewhere except for your deployment directory.
 
If that fails, I'd try another server and see if it works there.
 
Back to Top
ksmith View Drop Down
Newbie
Newbie
Avatar

Joined: 26-May-2010
Posts: 7
Post Options Post Options   Quote ksmith Quote  Post ReplyReply Direct Link To This Post Posted: 27-May-2010 at 6:57am

Yes, the client app is Silverlight. Here is the query:

var query = EntityManager.FieldServiceReports

.Where(fsr => fsr.MembershipUserId == _userId && fsr.ReportDate == SelectedReportDate)

.Include(FieldServiceReport.EntityPropertyNames.FieldServiceRecords);

 
I tried changing to include to another navigation property besides FieldServiceRecords and got the same error.
 
Keith
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 26-May-2010 at 8:18pm
Thats's weird.  Can you post the query with the includes?  Is the client app in Silverlight?
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down