Cosmo D
Cosmo D

Reputation: 845

Could not create the driver from NHibernate.Driver.OracleDataClientDriver (with copy local set to true)

I even added to app.config this little piece of config:

<qualifyAssembly partialName="Oracle.DataAccess"
             fullName="Oracle.DataAccess,
                            Version=2.112.2.0,
                           Culture=neutral,
                           PublicKeyToken=89b483f429c47342" />
    </assemblyBinding>

... with no success. What could be wrong? Also, just to be sure that my app.config is feng shui, here it is:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="hibernate-configuration"
    type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
  </configSections>
  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property name="show_sql">true</property>
      <property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
      <property name="connection.driver_class">
        NHibernate.Driver.OracleDataClientDriver
      </property>
      <property name="connection.connection_string_name">
        GuitarStore2
      </property>
      <property name="connection.provider">
        NHibernate.Connection.DriverConnectionProvider
      </property>
    </session-factory>
  </hibernate-configuration>
  <connectionStrings>
    <add name="GuitarStore"
    connectionString="****************"/>
  <add name="GuitarStore2"
    connectionString="****************"/>
  </connectionStrings>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <qualifyAssembly partialName="Oracle.DataAccess"
             fullName="Oracle.DataAccess,
                            Version=2.112.2.0,
                           Culture=neutral,
                           PublicKeyToken=89b483f429c47342" />
    </assemblyBinding>
  </runtime>
</configuration>

For the record, I am using the latest Nhibernate (3.3.1), on .NET 3.5, under Windows 7 64 bit. And, with the exact same project, I encounter no exceptions on another machine, but with Windows XP.

Upvotes: 3

Views: 10690

Answers (1)

Cosmo D
Cosmo D

Reputation: 845

The problem wasn't NHibernate, but the fact that the IL was generating 64 bit code, whilst using the 32 bit version of ODP, so by simply changing the "Any CPU" option to "x86", I got rid of the exception.

Upvotes: 6

Related Questions