Entity Framework Application .Net 4.0 - Deployed To .Net 4.5 Results In Errors

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jwhblues2
Posts: 3
Joined: Wed 09 Nov 2011 16:19

Entity Framework Application .Net 4.0 - Deployed To .Net 4.5 Results In Errors

Post by jwhblues2 » Mon 04 Mar 2013 19:13

We have an application developed in Visual Studio 2010, Entity Framework 4 (LINQ for Entities), dotConnect For Oracle 5.6, with Oracle 11 database. The target when built is .Net 4.0 for everything. This runs fine when deployed to Server 2008 R2 with .Net 4.0 and Oracle 64-bit client.

Is it possible to deploy this to a Server 2008 R2 machine with Oracle 64-bit client, but .Net 4.5 installed(which removes .Net 4.0)?

We recently tried this deploy and while some of it worked, other parts actually produced SQL that was invalid for Oracle. I had read a few forum posts regarding .Net 4.5 compatibility issues, but what we observed is different than what was discussed in those posts.

For example, a LINQ for Entities statement that uses a YEAR extension on a date field creates invalid Oracle SQL. Given an Oracle table (ACCTGDATE) with a key field of type DATE (ACTUALDATE) populated with accounting calendar information (i.e. 1 row for each day of a year), a LINQ statement to get all rows for a given year (CURYEAR) would be:

var curYearInfo = context.ACCTGDATEs.WHERE(a => a.ACTUALDATE.YEAR == CURYEAR).ToArray();

When deployed to .Net 4.0 environment, the WHERE clause of the resulting Oracle SQL is:
FROM ACCTGDATE "Extent1"
WHERE (EXTRACT(YEAR FROM ("Extent1".ACTUALDATE))) = :p__linq__0

However, when deployed to the .Net 4.5 environment, the WHERE clause of the resulting Oracle SQL is now:
FROM ACCTGDATE "Extent1"
WHERE (Year("Extent1".ACTUALDATE)) = :p__linq__0

This does not parse in Oracle as valid SQL since the Year() function does not exist.

We also noticed similar behavior (i.e. bad SQL) on LINQ statements that used .ToUpper()

What options do we have short of migrating everying (VS, dotConnect, Entity Developer, EF, etc) to versions that support and can target .Net 4.5?

Do you think the problem would go away if .Net 4.0 was also present on the server (if that is even an option for 4.0 and 4.5 to be on the same machine)?

Is the problem in dotConnect, or Entity Framework?


Thanks,

Jeff

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Entity Framework Application .Net 4.0 - Deployed To .Net 4.5 Results In Errors

Post by Shalex » Wed 06 Mar 2013 08:00

You are using an old version of dotConnect for Oracle. Please upgrade to the latest (7.6.192) version and notify us if this fixes the problems.

jwhblues2
Posts: 3
Joined: Wed 09 Nov 2011 16:19

Re: Entity Framework Application .Net 4.0 - Deployed To .Net 4.5 Results In Errors

Post by jwhblues2 » Mon 11 Mar 2013 19:38

Yes - upgrade to latest version fixed the problem. Thanks.

Post Reply