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: The dialect was not set problem in Windows Forms
PostPosted: Mon Sep 24, 2007 6:20 am 
Newbie

Joined: Mon Sep 24, 2007 5:39 am
Posts: 2
Location: Manila, Philippines
Hibernate version: 1.04

I'm aware that there have been people who have encountered the "The dialect was not set. Set the property hibernate.dialect" in ASP.NET projects.

In my case we've encountered this problem in a Windows Forms application using a modified MVP approach:

Image

The bad thing is this happens in the Design View of our UI -- what I did was to simply move from Code View to Design View. To be able to add elements to the designer (ever tried doing WinUI over code? not pretty, unlike in ASP.NET) we need to comment out other objects that have even the remotest dependency to NHibernate.

I've tried:

1. adding an app.config file to contain the hibernate.dialect definition
2. adding hibernate.cfg.xml to the project and setting its compile action to copy to output directory, a solution I tried after I found here: http://forums.visual-paradigm.com/posts/list/1785.html

Needless to say, neither solution worked.

Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 24, 2007 7:00 am 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
It looks like the constructor of the form does something that causes NHibernate to configure itself at design time (like building the SessionFactory). Try moving the code that configures NHibernate to the application startup and make sure the SessionFactory is only build once when running the application.

_________________
Cuyahoga


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 4:24 am 
Newbie

Joined: Mon Sep 24, 2007 5:39 am
Posts: 2
Location: Manila, Philippines
martijnb wrote:
It looks like the constructor of the form does something that causes NHibernate to configure itself at design time (like building the SessionFactory). Try moving the code that configures NHibernate to the application startup and make sure the SessionFactory is only build once when running the application.


I know, and I have peppered the constructors and the Load events with if (!DesignMode) {} constructs but to no avail. Not sure what else I need to do.


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.