By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

NHibernate application configuration...

P: n/a
The documents on their website are completely wrong. Following is the a
real example that works with NHibernate 1.0.2.0:

<?xml version="1.0" encoding="utf-8"?>
<configuration
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<!-- SecurityException is thrown if NHibernate assembly is not in
GAC. -->
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler"/>
</configSections>
<!-- NHibernate configuration:
---- xmlns="urn:nhibernate-configuration-2.0" must be present to pass
validation.
-->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.0">
<session-factory>
<!-- Database Settings -->
<property
name="hibernate.connection.provider">NHibernate.Co nnection.DriverConnectionProvider</property>
<property
name="hibernate.connection.driver_class">NHibernat e.Driver.SqlClientDriver</property>
<property
name="hibernate.connection.connection_string">Serv er=(local);Database=myDB;User
ID=myName;Password=myPassword</property>
<property
name="hibernate.dialect">NHibernate.Dialect.MsSql2 000Dialect</property>
<!-- Transaction Settings -->
<property
name="hibernate.connection.isolation">ReadCommitte d</property>
<!-- [optional] specify default schema, for improving performance
-->
<property name="hibernate.default_schema">myDB.dbo</property>
<!-- Display SQL (useless for .NET?) -->
<property name="hibernate.format_sql">true</property>
<property name="hibernate.show_sql">true</property>
</session-factory>
</hibernate-configuration>
......

NHibernate.dll *must* be added into GAC before you can use the section
handler in .config.
Cheers!

Mar 18 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.