Oracle10g and app using ODP.NET 10.2.0.2

Posts   
 
    
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 10-Aug-2006 16:31:50   

I've managed to get my .net app working with LLBL using ODP.NET 10.2.0.2 on client machines.

However, I get the following error when running the client app on the SAME machine as the server. We really need this capability for performance reasons.

System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' at LLBLMuF18.HelperClasses.DbUtils.DetermineConnectionToUse(ITransaction ......and so on.

Researching the issue, I've come up with a few questions/comments:

  1. Does LLBL create ".net stored procedures"? if so, then this link instructs that I install: Oracle Database Extensions for .NET. I have had difficulty in trying this. And I am not sure if it will yield desired results.

http://www.oracle.com/technology/tech/windows/odpnet/faq.html#installDB

  1. Installing ODP.NET on same machine will have problems solved by some oracle fix from this link. http://forums.oracle.com/forums/message.jspa?messageID=1249673

  2. Here is oracle's site for .net developer tools, which contain the "Database extensions". The problem here is I do not want Visual Studio 200X installed on the database server.

http://www.oracle.com/technology/software/tech/dotnet/odt10202rn.html#System_Requirements

Sorry to post an ear (or two) full, but I'm really looking forward to running the client app on the server machine.

Thanks, Darren

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 10-Aug-2006 17:12:16   

Puromtec wrote:

I've managed to get my .net app working with LLBL using ODP.NET 10.2.0.2 on client machines.

However, I get the following error when running the client app on the SAME machine as the server. We really need this capability for performance reasons.

System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342' at LLBLMuF18.HelperClasses.DbUtils.DetermineConnectionToUse(ITransaction ......and so on.

Please add:


<dependentAssembly>
    <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"/>
    <bindingRedirect oldVersion="10.1.0.000-10.2.0.100" newVersion="2.102.2.20"/>
</dependentAssembly>

with the proper surrounding tags as stated in the llblgenpro.exe.config file, to your application's .config file.

Researching the issue, I've come up with a few questions/comments:

  1. Does LLBL create ".net stored procedures"? if so, then this link instructs that I install: Oracle Database Extensions for .NET. I have had difficulty in trying this. And I am not sure if it will yield desired results. http://www.oracle.com/technology/tech/windows/odpnet/faq.html#installDB

LLBLGen Pro doesn't generate stored procedures, so also not .NET stored procedures.

  1. Installing ODP.NET on same machine will have problems solved by some oracle fix from this link. http://forums.oracle.com/forums/message.jspa?messageID=1249673

Thanks for the link simple_smile

  1. Here is oracle's site for .net developer tools, which contain the "Database extensions". The problem here is I do not want Visual Studio 200X installed on the database server.

http://www.oracle.com/technology/software/tech/dotnet/odt10202rn.html#System_Requirements

Sorry to post an ear (or two) full, but I'm really looking forward to running the client app on the server machine. Thanks, Darren

Oracle's vs.net extensions shouldn't be necessary to work with Oracle and LLBLGen Pro. At the moment LLBLGen Pro doesn't support .NET features inside Oracle as in: .NET UDT's. So if you write a UDT in C# and install it inside Oracle 10g v2 with the .NET extensions, you can't use it with LLBLGen Pro despite the fact you're using 10.2 of ODP.NET. This feature will be added in the (near) future, though a date hasn't been set. Stored procedures in Oracle should be callable like any other stored proc.

Frans Bouma | Lead developer LLBLGen Pro
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 10-Aug-2006 17:25:56   

two things:

  1. Adding this to my llblgen.exe.config causes the error below upon opening my llblgen project:

<dependentAssembly> <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"/> <bindingRedirect oldVersion="10.1.0.000-10.2.0.100" newVersion="2.102.2.20"/> </dependentAssembly>

ERROR>>>>>>>>>>>> Exception has been thrown by the target of an invocation. File or assembly name Oracle.DataAccess, or one of its dependencies, was not found.

  1. It only works if i add this to llblgen.exe.config (note the "oracle version of the version": <dependentAssembly> <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"/> <bindingRedirect oldVersion="10.1.0.000-10.2.0.100" newVersion="10.2.0.2.20"/> </dependentAssembly>

However, my app config only takes the bindingRedirect with "2.102.2.20" and works nicely, while running from client machine. Again, the app gives up error when run on server machine.

Do you think that because I can't get llblgen to run with the 2.102.2.20 (and instead using 10.2.2.20), I am preventing client app from running on db server machine?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 10-Aug-2006 18:04:08   

Puromtec wrote:

two things:

  1. Adding this to my llblgen.exe.config causes the error below upon opening my llblgen project:

<dependentAssembly> <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"/> <bindingRedirect oldVersion="10.1.0.000-10.2.0.100" newVersion="2.102.2.20"/> </dependentAssembly>

ERROR>>>>>>>>>>>> Exception has been thrown by the target of an invocation. File or assembly name Oracle.DataAccess, or one of its dependencies, was not found.

  1. It only works if i add this to llblgen.exe.config (note the "oracle version of the version": <dependentAssembly> <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"/> <bindingRedirect oldVersion="10.1.0.000-10.2.0.100" newVersion="10.2.0.2.20"/> </dependentAssembly>

However, my app config only takes the bindingRedirect with "2.102.2.20" and works nicely, while running from client machine. Again, the app gives up error when run on server machine.

Do you think that because I can't get llblgen to run with the 2.102.2.20 (and instead using 10.2.2.20), I am preventing client app from running on db server machine?

That's really strange. The redirect I posted was found by another user who uses ODP.NET 10.2 with the designer and needed that redirect to make the designer work... Very odd. What I also find odd is that you have to specify 5 elements in the version, which is IMHO not valid (but apparently it works).

Frans Bouma | Lead developer LLBLGen Pro
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 10-Aug-2006 19:11:25   

Taken from earlier link i posted:

Q: In ODP.NET 10.2.0.2 and higher, why does the same ODP.NET provider have two different version numbers?

A: For ODP.NET 10.2.0.2 and higher, the same ODP.NET binaries have two different version numbers when viewed from either .NET products (e.g. Visual Studio 2005 would see version 2.102.2.20) or when viewed from Oracle products (e.g. Oracle Universall Installer would see version 10.2.0.2.20). Prior to ODP.NET 10.2.0.2, the latter versioning was employed exclusively. The use the second versioning method was necessary to properly support .NET policy files for .NET Framework 1.x and 2.0.

For further details, read the versioning scheme section of Chapter 2 of the Oracle Data Provider for .NET (10.2.0.2 or higher) Developer's Guide .


...when first setting up an llblgen project, in the database settings, it lists the database drivers in that drop down (e.g. Oracle 10g Driver (ODP.NET 10.1.x)), hence my need for 10.2.... However, when llblgen produces the project code, there is a reference to the dll: E:\oracle\product\10.2.0\client_2\odp.net\bin\2.x\Oracle.DataAccess.dll (my dev machine), having version: 2.102.2.20

My generated code then must have redirect to 2.102.2.20. (truly why..i don't know)

But, apart from this bindingRedirect mess, I'm stuck on getting app to run on same machine as db server.

btw, to confuse matters, newVersion=10.2.0.2 also works in my llblgen config. (without last ".20")

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 10-Aug-2006 20:26:17   

Ah, so the 10.2.0.2 is for .NET 1.x and the 2.102.2.20 version is for .NET 2.0. The designer of LLBLGen Pro v2.0 uses .NET 2.0, so you need 2.102.2.20 to be the redirect target, if you generate .NET 1.x code, you then need to redirect your OWN code in your own config file to 10.2.0.2. </wildguess>

Frans Bouma | Lead developer LLBLGen Pro
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# Posted on: 11-Aug-2006 16:38:16   

problem identified:

can't run ODP.net on x64 Windows

http://forums.oracle.com/forums/thread.jspa?threadID=411150&tstart=0

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 11-Aug-2006 18:12:42   

hmm, that's a strange limitation though... AFAIK their CLI implementation is in java... Thanks for the link, Puromtec!

Frans Bouma | Lead developer LLBLGen Pro