-->
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: The dialect was not set. Set the property hibernate.dialect.
PostPosted: Fri Jul 13, 2007 1:41 pm 
Newbie

Joined: Fri Jul 13, 2007 1:36 pm
Posts: 6
I am getting this error:

The dialect was not set. Set the property hibernate.dialect.

I have set the dialect in web.config:

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Server=(local);Database=School;Trusted_Connection=true</property>

<mapping assembly="DriverWebApp" />
</session-factory>
</hibernate-configuration>

Any help please!


Top
 Profile  
 
 Post subject: Poor Documentation of NHibernate
PostPosted: Fri Jul 13, 2007 1:47 pm 
Newbie

Joined: Fri Jul 13, 2007 1:36 pm
Posts: 6
I have to say that the documentation is very poor. I downloaded the documentation and in the documentation they are referring to the <property> tags inside the web.config. But those tags are not being read from the server side code. So, I replaced them with the nhibernate <add and key tags and it worked.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 2:18 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Where does the documentation refer to <property> tags in web.config?


Top
 Profile  
 
 Post subject: RE:
PostPosted: Fri Jul 13, 2007 4:19 pm 
Newbie

Joined: Fri Jul 13, 2007 1:36 pm
Posts: 6
The following code has been taken from the Compiled Documentation file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- Add this element -->
<configSections>
<section
name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"
/>
</configSections>

<!-- Add this element -->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Server=(local);initial catalog=quickstart;Integrated Security=SSPI</property>

<mapping assembly="QuickStart" />
</session-factory>
</hibernate-configuration>

<!-- Leave the system.web section unchanged -->
<system.web>
...
</system.web>
</configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 4:27 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Yes, and this works. You probably didn't set the configuration section handler in your web.config.

Or you didn't call Configuration.Configure().


Top
 Profile  
 
 Post subject: RE:
PostPosted: Fri Jul 13, 2007 4:45 pm 
Newbie

Joined: Fri Jul 13, 2007 1:36 pm
Posts: 6
Also, what does my class "Customer" properties have to be virtual and every method has to be virtual?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 5:01 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Please start new topics for new questions.


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.