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.  [ 3 posts ] 
Author Message
 Post subject: Configuration problem
PostPosted: Mon Feb 11, 2008 10:59 pm 
Newbie

Joined: Tue Sep 05, 2006 11:15 pm
Posts: 7
I am constructing my new application using the following structure.
App (Storing the solution files only)
--- App.Web (web.config including the NHibernate configuration)
--- App.BLL
--- App.BO (POCO objects)
--- App.DAL (NHibernateHttpModule and BaseDataAccess from Beansoftware)

The sessionFactory is configured inside the NHibernateHttpModule which located in the DAL assembly. It seems not able to read the configuration file in the web.config. I am able to create another configuration inside the DAL project but I don't want to scatter my configuration.

Moreover, is there any good sample or recommendation with n-tier architecture with NHibernate available?

Code reference:
http://www.beansoftware.com/ASP.NET-Tut ... g4Net.aspx

Error Message:
The hibernate.connection.driver_class must be specified in the NHibernate configuration section.

Hibernate version:
NHibernate 1.2.1.GA

Full stack trace of any exception that occurs:
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings) at NHibernate.Connection.UserSuppliedConnectionProvider.Configure(IDictionary settings) at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary settings) at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties) at NHibernate.Cfg.Configuration.BuildSettings() at NHibernate.Cfg.Configuration.BuildSessionFactory() at Mekim.SalaryPlanning.DAL.BaseDataAccess.getFactory() in C:\Projects\Web Application\branches\SalaryPlanning\SalaryPlanning.DAL\BaseDataAccess.vb:line 24 at Mekim.SalaryPlanning.DAL.BaseDataAccess.OpenSession() in C:\Projects\Web Application\branches\SalaryPlanning\SalaryPlanning.DAL\BaseDataAccess.vb:line 34 at Mekim.SalaryPlanning.DAL.NHibernateHttpModule.context_BeginRequest(Object sender, EventArgs e) in C:\Projects\Web Application\branches\SalaryPlanning\SalaryPlanning.DAL\NHibernateHttpModule.vb:line 25 at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Name and version of the database you are using:
SQL Server 2005


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 6:19 pm 
Regular
Regular

Joined: Tue Dec 25, 2007 3:41 pm
Posts: 57
Location: Argentina
Hi,

The problem looks like NH doesn't can look the web.config with the configuration.

Did you read this article ?
http://www.codeproject.com/KB/architect ... tices.aspx

By the way, we are waiting for NHibernate.Burrow, that is the brand new project of NHibernate.Contrib. NHB will provide the capabilities for managment of NHibernate Session.
http://sourceforge.net/projects/nhcontrib/

Best regards

_________________
Dario Quintana


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 9:28 pm 
Newbie

Joined: Tue Sep 05, 2006 11:15 pm
Posts: 7
I've figured out the problem now. You are right. Hibernate can't read the web.config file. I just know that I need to add the reference of System.Web into my class library. The hibernate can read the config automatically now. Thanks.

For the best practice project, I have already got it before. However, I am not strong in OOP. It takes me more time to understand it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.