He says, exception messages are gold!
On Sat, Sep 27, 2008 at 7:52 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote:
> *NHibernate.HibernateException : The dialect was not set. Set
> the property hibernate.dialect.*
>
> On Sat, Sep 27, 2008 at 7:42 PM, Berryl Hesh <[EMAIL PROTECTED]> wrote:
>
>>
>> I'm using Castle.ActiveRecord (1.0.3.0) over NHibernate (1.2.0.4000)
>> in some sample code that is partly discussing Active Record as a
>> design pattern that promotes unit testing. Below is the
>> exception, .config, and code where the exception starts.
>>
>> Thanks for your help! BH
>>
>> ***** Exception (w/ stack trace)
>> //-------------------------------//
>> TestCase 'OMG.DataAccess.Tests.CustomerRepositoryTest.GetCustomerTest'
>> failed: Castle.ActiveRecord.Framework.ActiveRecordException : Error
>> adding information from class OMG.Domain.Model.Customer to NHibernate.
>> Check the inner exception for more information
>> ----> NHibernate.MappingException : Could not compile the mapping
>> document: (string)
>> ----> NHibernate.HibernateException : The dialect was not set. Set
>> the property hibernate.dialect.
>> at
>> Castle.ActiveRecord.ActiveRecordStarter.AddXmlString(Configuration
>> config, String xml, ActiveRecordModel model)
>> at
>>
>> Castle.ActiveRecord.ActiveRecordStarter.AddXmlToNHibernateCfg(ISessionFactoryHolder
>> holder, ActiveRecordModelCollection models)
>> at
>>
>> Castle.ActiveRecord.ActiveRecordStarter.RegisterTypes(ISessionFactoryHolder
>> holder, IConfigurationSource source, IEnumerable`1 types, Boolean
>> ignoreProblematicTypes)
>> at
>> Castle.ActiveRecord.ActiveRecordStarter.Initialize(IConfigurationSource
>> source, Type[] types)
>> C:\Documents and Settings\Owner\My Documents\Visual Studio
>> 2008\Projects\Learning\Lab\OMG.DataAccess\OMG.DataAccess
>> \DataAccessHelper.cs(24,0): at
>> OMG.DataAccess.DataAccessHelper.Initialize()
>> C:\Documents and Settings\Owner\My Documents\Visual Studio
>> 2008\Projects\Learning\Lab\OMG.DataAccess\OMG.DataAccess\Repository
>> \RepositoryBase.cs(12,0): at
>> OMG.DataAccess.Repository.RepositoryBase`2..ctor()
>> at OMG.DataAccess.Repository.CustomerRepository..ctor()
>> C:\Documents and Settings\Owner\My Documents\Visual Studio
>> 2008\Projects\Learning\Lab\OMG.DataAccess.Tests\OMG.DataAccess.Tests
>> \CustomerRepositoryTest.cs(20,0): at
>> OMG.DataAccess.Tests.CustomerRepositoryTest.Setup()
>> --MappingException
>> at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
>> at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument
>> doc,
>> String name)
>> at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader
>> hbmReader,
>> String name)
>> at NHibernate.Cfg.Configuration.AddXml(String xml, String name)
>> at NHibernate.Cfg.Configuration.AddXml(String xml)
>> at NHibernate.Cfg.Configuration.AddXmlString(String xml)
>> at
>> Castle.ActiveRecord.ActiveRecordStarter.AddXmlString(Configuration
>> config, String xml, ActiveRecordModel model)
>> --HibernateException
>> at NHibernate.Dialect.Dialect.GetDialect()
>> at NHibernate.Dialect.Dialect.GetDialect(IDictionary props)
>> at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument
>> doc,
>> String name)
>>
>> ***** Code Where error occurs starts
>> //-------------------------------------------------//
>> private static XmlConfigurationSource _source;
>> private static ISessionFactory _sessionFactory;
>> public ISession _session;
>> private static ISessionFactoryHolder _sessionFactoryHolder;
>>
>> public static void Initialize() {
>> if (_source != null) return;
>> ActiveRecordStarter.SessionFactoryHolderCreated +=
>> ActiveRecordStarter_SessionFactoryHolderCreated;
>> _source = new XmlConfigurationSource("../../
>> appconfig.xml");
>> ActiveRecordStarter.Initialize(_source, typeof(Customer),
>> typeof(Order));
>> }
>>
>> ***** Config (appconfig.xml)
>> //-------------------------------//
>> <activerecord>
>>
>> <config>
>> <add
>> key="connection.driver_class"
>> value="NHibernate.Driver.SqlClientDriver" />
>> <add
>> key="dialect"
>> value="NHibernate.Dialect.MsSql2000Dialect" />
>> <add
>> key="connection.provider"
>> value="NHibernate.Connection.DriverConnectionProvider" />
>> <add
>> key="connection.connection_string"
>> value="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\SQL
>> Server 2000
>> Sample Databases\NORTHWND.MDF;Integrated Security=True;Connect
>> Timeout=30;User Instance=True" />
>> </config>
>>
>> </activerecord>
>>
>>
>>
>
> >
>
--
Tuna Toksöz
Typos included to enhance the readers attention!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---