-->
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: Architecture question
PostPosted: Thu Jul 26, 2007 12:46 pm 
Newbie

Joined: Thu Jul 26, 2007 9:24 am
Posts: 1
Hibernate version:
NHibernate 1.2

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

My question is regarding the approach we are trying to take for a web app using NHibernate.

From front to back, we have an ASP.NET front-end that calls a web service which in turn calls a data access DLL that has all the objects that we are linking to the database via NHibernate.

The data access DLL that carries all the data objects/mappings works fine. I have an App.config file with the nhibernate configuration data in this DLL. When unit testing this object, no problems.

We tried to use that DLL from the web service encounterd the following error: "The dialect was not set. Set the property hibernate.dialect."

It turned out that we needed to have the nhibernate configuration data in the Web.config of the web service as well as the data access DLL. Once we added the nhibernate configuration data from the DLL's App.config to the web service's Web.config we were able to use data access DLL in the web service no problem.

Is this by design, or are we doing something wrong? It seemed to us when we started that all the nhibernate interaction (including configuration) could exist in the one DLL. Now it appears we will need to carry the configuration data in anything that also is a consumer of the data access DLL.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 27, 2007 1:12 pm 
Regular
Regular

Joined: Fri Jan 27, 2006 2:32 pm
Posts: 102
Location: California, USA
Unless you hard-code the configuration information into your data access DLL, you are going to have to provide the app.config file.

There are other ways of configuring NHibernate, but basically, if you don't hard-code, then everywhere the data access DLL is used, it is going to need to load those configuration values.

I'm not sure what you're hoping for.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 30, 2007 1:14 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
Just one addition: you may be confused because you unit tester (NUnit, I'm guessing) consumed your xxx.dll.config file. However, this is something "special" that NUnit does to make unit testing a little smoother. In general, applications will not consume .dll.configs without being coded to do so. You might notice that VS doesn't even build a config for a .dll from the app.config in the project.

This is by design: the assumption is that any and all components of an application will be configured at the application level, not come "preconfigured" as it were.


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.