views:

35

answers:

0

I have used SQL Server 2008 configured in hibernate.cfg.xml file and everything worked fine. Once I tried to use SQLite in memory.. I have having the following issues...

hibernate.cfg.xml

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
  <session-factory>
    <property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
    <property name="connection.connection_string">Data Source=:memory:;Version=3;New=True;</property>
    <property name="connection.isolation">ReadCommitted</property>
    <property name="connection.release_mode">on_close</property>
    <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>
</configuration>

in the Code:

Configuration cfg = new Configuration();
cfg.AddMappingsFromAssembly(//my mapping assembly);
return Fluently.Configure(cfg).BuildSessionFactory();

error: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

  • Database was not configured through Database method.
  • No mappings were configured through the Mappings method.

When I step through the code and can see the all the property values loaded from hibernate.cfg.xml file. Still it fails. Any suggestion is appreciated.

thanks,