-->
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.  [ 2 posts ] 
Author Message
 Post subject: NHibernate Configuration Multiple dialects?
PostPosted: Wed May 02, 2007 12:27 pm 
Newbie

Joined: Wed May 02, 2007 12:12 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
1.2.0

I'm writing a db application.

The problem is that some of the database servers are SQL2000 and some are SQL2005.

I think that, in the future, the databases will all be upgraded to SQL2005, but I'm not SURE of this.

The database application will be relatively simple...just straight altering of tables.

My question is this:

Should I write the app using <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> or <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>?

Can I use both?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 2:54 am 
Newbie

Joined: Thu May 03, 2007 2:30 am
Posts: 18
Hello!

You can only use "one dialact per Session" (=DB Connection) but you can freely switch between the different dialects when targeting different Servers. NHibernate will use the dialect you select to construct the correct querry for the target Platform. (e.g. To querry a recursive datastructure it will use a "connect by..." if you have an Oracle and a "CTE" if you target a sql2005 Server)

The "goal" of NHibernate is to make you no longer DB dependant. So you only need to change the configuration in order to use another DB (Some restrictions apply with ID Fields... e.g. a SQL Server wont support a sequence generator)

So short answer: Pick the right dialect for your server. A SQL2000 SHOULD work with a SQL2005, but you will miss out on some of the features...


Hope this helps


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