locked
Calling Oracle query in a 64 bit host instance: 'The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception RRS feed

  • Question

  • Hi,

    Currently I have an issue in Biztalk with calling Oracle 11g.

    I'm calling a method in an external assembly in an Biztalk 2010 orchestration in an Expression shape. It's a Windows 2008 (64-bit) box. This method executes a query on a Oracle 11g database and makes use of ODP.NET. I installed 64-bit ODP.NET for 11g on my machine. In the GAC there's a Oracle.DataAccess dll (version 2.112.2.0, processor architecture AMD64). There's no x86 version of this assembly in the GAC.

    However, the orchestration only runs ok if I let it run with a Biztalk host having the setting '32-bit only' set to true. If the orchestration runs on a 64-bit host, the service instance suspends with the error 'The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.'

    When I debug the external assembly in VS2010, it works fine. The Oracle client can be instantiated and a query can be executed succesfully.

    Any thoughts on why it won't run on a 64 bit host instance?
    • Moved by Steef-Jan WiggersMVP Friday, October 21, 2011 3:19 PM BizTalk Adapter Pack related (From:BizTalk Server General)
    Thursday, October 20, 2011 9:34 AM

Answers

  • You still seem to be having the 32 bit version of the ODP.net library in your machine and since VS runs in 32 bit mode , it seems to be working.

    You need to completely remove the Oracle Client (current version) and re-install the 64 bit one.You may verify the correct installation by checking the presence of the 'Oracle.DataAccess' assembly inside " C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess".

    To make double sure that Oracle Client has installed / GAC'ed the correct version you may manually GAC the asssembly from " C:\oracle\odp.net\bin\4 "


    In case my post helped you , please do indicate that :-) Amit Shukla http://blogs.msdn.com/b/bizintegration1/
    Friday, October 21, 2011 9:22 AM
  • Hi,

    Have you checked the machine.config file for both 32 and 64 bit if the adapter bindings are registered? See installation manual of BizTalk Adapter Pack on manually registering the adapter bindings.

    HTH

    Regards,

    Steef-Jan Wiggers
    MVP & MCTS BizTalk Server 2010
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Friday, October 21, 2011 3:26 PM

All replies

  • Check your Oracle Client and make sure that you're running 64-bit. I believe that the VS query works because it runs as a 32-bit process.
    Ed Jones, MCPD, MCTS: BizTalk, WCF talentedmonkey@hotmail.com http://talentedmonkeys.wordpress.com
    Thursday, October 20, 2011 8:49 PM
  • You still seem to be having the 32 bit version of the ODP.net library in your machine and since VS runs in 32 bit mode , it seems to be working.

    You need to completely remove the Oracle Client (current version) and re-install the 64 bit one.You may verify the correct installation by checking the presence of the 'Oracle.DataAccess' assembly inside " C:\Windows\Microsoft.NET\assembly\GAC_64\Oracle.DataAccess".

    To make double sure that Oracle Client has installed / GAC'ed the correct version you may manually GAC the asssembly from " C:\oracle\odp.net\bin\4 "


    In case my post helped you , please do indicate that :-) Amit Shukla http://blogs.msdn.com/b/bizintegration1/
    Friday, October 21, 2011 9:22 AM
  • Oracle is always a problem. I don't know why it's always so difficult to find and line up all those Oracle components. MySQL, also Oracle, always seems to work instantly :)

    So, find the right Oracle client, that's your first challenge. Everything has to line up here. Your ODP.Net should be the same as your Oracle client which is installed. Version numbers and 32/64 bits. 

    So please do as Amit says. Get rid of everything and do a new installation. Or you can try and install different versions of ODP.Net and the Oracle Client, but then you won't know which one you are using :)

    Friday, October 21, 2011 10:13 AM
  • Hi,

    Have you checked the machine.config file for both 32 and 64 bit if the adapter bindings are registered? See installation manual of BizTalk Adapter Pack on manually registering the adapter bindings.

    HTH

    Regards,

    Steef-Jan Wiggers
    MVP & MCTS BizTalk Server 2010
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Friday, October 21, 2011 3:26 PM