-->
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.  [ 14 posts ] 
Author Message
 Post subject: SQL Server and dialects ... explain this ...
PostPosted: Wed Feb 11, 2004 5:20 pm 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
i am moving my app from oracle to sql server 2000 (one customer user oracle and another sql server) and i search the docs at http://www.hibernate.org/hib_docs/reference/html/session-configuration.html#session-configuration-s5-1 and it tells me to use net.sf.hibernate.dialect.SQLServerDialect as the dialect. i made the other changes to my hibernate.properties file and started the app (runs in tomcat 4.x). i was suprised to find that hibernate didn't seem to connect to my DB. to make a log debug story short, i did a search and found at http://cvs.sourceforge.net/viewcvs.py/hibernate/Hibernate2/src/hibernate.properties?rev=1.19 a properties setting of hibernate.dialect net.sf.hibernate.dialect.SybaseDialect as the sql server dialect. i changed the dialects and reloaded the app and it worked (connected to the DB). so what dialect should sql server users be using? seems the docs are not clear on which one.

as a side not, hibernate documentation is some of the best out there, i am not knocking the hibernate team effort, i just want to be sure we all have the right info.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 5:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I can hardly believe that, the Dialect has nothing to do with connection to the database, if the dialect was wrong you should rather see SQL Syntax errors or something like that.

Acutally SQLServerDialect is just a subclass of SybaseDialect which did not exist some time ago (back then, SybaseDialect was used for SQL Server)

So I believe you have changed something else on the way.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 5:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You are mistaken. The Dialect does not affect db connection.


Top
 Profile  
 
 Post subject: well, the reason i thought the dialect was the root cause
PostPosted: Wed Feb 11, 2004 5:37 pm 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
was because when using the sqlserver dialect i would get a mapping error (could not compile mapping document, duplicate import). when i changed the dialect the error was gone. so it seems there is something going on with the errors that are returned with the different dialects. after your postings i tested just changing the dialects and what i listed above was the result. any thoughts on this? why i would get a mapping error with one dialect and not another?

thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 5:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I really find that hard to believe, this duplicate import errors usually are a sign of a DTD violation. I really can't imagine that the Dialect setting has an effect on this. Are you SURE the only thing you are changing is the Dialect?


Top
 Profile  
 
 Post subject: as odd as it sounds, yes.
PostPosted: Wed Feb 11, 2004 5:48 pm 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
the only thing i changed was the dialect.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 5:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
What Hibernate Version are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 6:03 pm 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
hibernate 2.0
file size = 696605
jar file name = hibernate2.jar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 6:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well, the reason may be that Hibernate 2.0 does not include SQLServerDialect at all?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 6:13 pm 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
there ya have it http://www.hibernate.org/hib_docs/reference/html/ and notice the version 2.1.2.

so that is the issue, i am running an older version and didn't get the right version of the help doc. but the only link on http://www.hibernate.org/5.html is for this version and therefore my misunderstanding. really i had no way to know that the sqlserver dialect was not supported under 2.0 unless i downloaded and saved the docs for version 2.0.

i should upgrade to 2.1.2.

thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 6:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Actually the Docs are included in the distribution.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 8:00 am 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
seems to be better proactice to hold on to the dist. and not just the hibernate jar. it may not be a bad idea to keep posted on the hibernate site the docs for all the versions, in similar manner to Sun with new JDK releases. it is all too often you inherit an application and only have the JAR file and not the dist file that includes the docs and therefore have to rely on what is posted on the web.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 8:02 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You can download all previous releases on SourceForge, including the relevant documentation.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 8:12 am 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
yep i see that now. excellent.
thank you for all your help and clearng up my ignorance.
keep up the excellent work.


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