These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: 2.0 Beta 2 - Configuration - "Could not find the dialec
PostPosted: Thu Jul 24, 2008 4:51 pm 
Regular
Regular

Joined: Thu Nov 30, 2006 10:48 am
Posts: 59
I switched to nHibernate release 2.0 beta 2. I received
Could not find the dialect in the configuration and then changed the config section in App.config. When I received the error again, I made the changes based on the release notes and the info at http://www.manning-sandbox.com/thread.jspa?messageID=72781. But it's still not working. Any ideas? Thanks --

<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate" requirePermission="false"/>
</configSections>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.0">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Data Source=localhost;initial catalog=MyDb;Integrated Security=SSPI</property>
</session-factory>
</hibernate-configuration>

_________________
metazone


Top
 Profile  
 
 Post subject: Re: Release 2.0 Beta 2 - configuration / dialect not found
PostPosted: Fri Jul 25, 2008 1:12 pm 
Regular
Regular

Joined: Thu Nov 30, 2006 10:48 am
Posts: 59
This works -- based on info from a website that I forgot the URL for ---

<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory>
<property name="dialect">
NHibernate.Dialect.MsSql2005Dialect
</property>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="connection.connection_string">
Server=localhost;
Database=MyDb;
Integrated Security=True;
</property>
</session-factory>
</hibernate-configuration>

_________________
metazone


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 2:54 pm 
Newbie

Joined: Fri Jul 25, 2008 8:43 am
Posts: 2
the difference being changing:

urn:nhibernate-configuration-2.0

TO

urn:nhibernate-configuration-2.2


Top
 Profile  
 
 Post subject: What's urn in for?
PostPosted: Mon Jan 05, 2009 10:43 pm 
Beginner
Beginner

Joined: Mon Jan 05, 2009 7:08 am
Posts: 24
hello

What's urn in mapping file for?

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">

Also I changed to 2.2 and still getting the same message:

InnerException = {"Could not find the dialect in the configuration"}

My xml file seems simple (and flawless)

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">

<class name="Util.Person, Util" table="Person">
<id name="Id" column="Id" type="Int64" unsaved-value="0">
<generator class="native" />
</id>
<property name="FirstName" column="FirstName" type="String(50)"/>
<property name="MiddleName" column="MiddleName" type="String(50)"/>
<property name="LastName" column="LastName" type="String(50)"/>
<property name="Login" column="Login" type="String(50)"/>
<property name="PrimaryEmail" column="PrimaryEmail" type="String(255)"/>
<property name="PasswordHash" column="PasswordHash" type="Int32"/>

</class>
</hibernate-mapping>

And I'm using this version: "NHibernate-2.0.1.GA-bin.zip"


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 06, 2009 3:48 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">

That's the namespace declaration. Can you post your configuration ? There are some breaking changes with 2.0.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject: thanks
PostPosted: Tue Jan 06, 2009 4:41 am 
Beginner
Beginner

Joined: Mon Jan 05, 2009 7:08 am
Posts: 24
thanks it turns out to be fact I didn't call "Configure" before adding assembly!


Configuration cfg_AuditTrail = new Configuration();
cfg_AuditTrail.Configure("../../AuditTrail.hibernate.cfg.xml");
ISessionFactory oNHFactory_AuditTrail = cfg_AuditTrail.BuildSessionFactory();
oContext.NhibernateConfigFactories.Add(Util.NHibernateDBUtil.AUDITTRAIL, oNHFactory_AuditTrail);
cfg_AuditTrail.AddAssembly(typeof(Util.Security.AuditTrailLog).Assembly); // This should be the one and only assembly to add.

See above, I should have called "Configure()" before calling "AddAssembly".

Thanks though - but wish to know more about the urn tag. The significance of it...?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 06, 2009 6:00 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Afaik in that case it's primarily used as some kind of versioning for the schema definition. There've been changes in the schema with nhib 1.2.

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.