我正在尝试使用微软的System.Data.OracleClient与Oracle一起使用Nhibernate
Nhibernate配置(它对Microsoft驱动程序是正确的吗?)
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="show_sql">true</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property>
<property name="cache.use_query_cache">true</property>
<property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
<property name="connection.connection_string">Data Source=localhost;User Id=jbadmin;Password=justbooks12;Integrated Security=no;</property>
</session-factory>
</hibernate-configuration>它抛出的异常
The IDbCommand and IDbConnection implementation in the assembly Oracle.DataAccess could not be found. Ensure that the assembly Oracle.DataAccess is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly. 我尝试将System.Data.OracleClient.dll复制到输出bin目录。没什么用。我还试图复制Oracle客户端dll以输出bin目录。这也没什么用。
异常显示“Oracle.DataAccess”程序集未找到。但微软的System.Data.OracleClient内部并没有这样的组装。它是在搜索Oracle的ODP驱动程序吗?
编辑:如果上面的配置是错误的,通过发布System.Data.OracleClient的配置来帮助我
发布于 2009-03-18 09:24:23
配置中的这一行:
<property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>指示NHibernate使用在Oracle.DataAccess.dll中找到的ODP.NET驱动程序。这允许NHibernate使用ODP.NET特性,如连接池和跟踪。根据安装的Oracle软件版本,您应该在类似于C:\Oracle\product\10.1.0\Client_1\BIN\的某个地方找到此程序集的副本。
如果您希望使用微软的System.Data.OracleClient驱动程序,请将这一行更改为:
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>发布于 2010-05-21 12:40:27
使用microsoft oracle驱动程序将大大降低您的性能。
https://stackoverflow.com/questions/657507
复制相似问题