I tried to configure the session but the visual studios tell me could not create a driver when I specified in the dbConfigObject.
I have the Oracle.DataAccess library and my connetion string in App.config. My code in FluentNhibernateHelper is like this:
public static class FluentNHibernateHelper
{
private static ISessionFactory _sessionFactory;
public static ISessionFactory SessionFactory
{
get
{
if (_sessionFactory == null)
{
var dbConfig = OracleDataClientConfiguration.Oracle10
.ConnectionString(c => c.FromConnectionStringWithKey("Oracle"))
.Driver<OracleDataClientDriver>()
.ShowSql();
_sessionFactory = Fluently.Configure()
.Database(dbConfig)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Empleado>())
.BuildSessionFactory();
}
return _sessionFactory;
}
}
public static ISession OpenSession()
{
return SessionFactory.OpenSession();
}
}
There is not enough information about the exception coming from NHibernate... but in case you get:
and because the code seems to be ok, you should check this Q & A:
Fluent NHibernate - Configure Oracle Data Provider ODP