my question:
I am trying to use Oracle.DataAccess.Client
Provider with NHibernate (Fluent), and I configured it as follows:
Fluently.Configure().Database(OracleClientConfiguration.Oracle10.Provider("Oracle.DataAccess.Client").ConnectionString(c => c.FromConnectionStringWithKey("ORACLE1"))).
and I have this error:
"Could not load type Oracle.DataAccess.Client. Possible cause: no assembly name specified.":"
I already add Reference to Oracle.Dataaccess
dll (ODAC) with copy local = true, but error persist...
Any suggestions?
Here's a working code snippet:
public static void InitializeNHibernate()
{
var configurer = (OracleClientConfiguration.Oracle10.ShowSql().ConnectionString(c =>
c.FromConnectionStringWithKey("development"))
.DefaultSchema("myschema")
.UseReflectionOptimizer()
.Cache(c =>
c.ProviderClass<SysCacheProvider>()
.UseQueryCache()));
var cfg = Fluently.Configure()
.Database(configurer)
.Mappings(m =>
{
m.FluentMappings
.AddFromAssemblyOf<Employee>()
.Conventions.Add<OracleDateTimeTypeConvention>();
m.HbmMappings
.AddFromAssemblyOf<Employee>();
})
.ExposeConfiguration(configuration =>
{
configuration.SetProperty(Environment.Hbm2ddlKeyWords, "auto-quote");
configuration.SetProperty(Environment.GenerateStatistics, "true");
configuration.SetProperty(Environment.CurrentSessionContextClass, "web");
configuration.SetProperty(Environment.CommandTimeout, "60");
});
}
Without specifying a provider, it automatically picks Oracle DataAccess up.
Edit:
It does not pick it up automatically, I just have it on my connection string:
<add name="development" connectionString="Data Source=XXX;User ID=yyy;Password=zzz;" providerName="Oracle.DataAccess.Client"/>