-->
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.  [ 4 posts ] 
Author Message
 Post subject: SQL Server 2000 Dialect in Hibernate 4.1.9
PostPosted: Fri Jan 18, 2013 5:11 am 
Newbie

Joined: Fri Jan 18, 2013 4:45 am
Posts: 5
I am upgrading from 3.5.2 to 4.1.9
I am using SQL Server 2000
The error i see is
[SQLServer JDBC Driver][SQLServer]Column or parameter #9: Cannot find data type boolean.

Upon some investigation, i found that SQL Server does not have a boolean type.
Hibernate 3.5.2 used to hardcode the type of boolean to Types.bit in org.hibernate.type.BooleanType.sqlType().
Hibernate 4.1.9 does not do that.

One related bug i found is
https://hibernate.onjira.com/browse/HHH-6420

The commit for this bug is
https://github.com/hibernate/hibernate-orm/commit/d9680adcba4625f6330be7adfebb6fbcd2fb422d

Now in that commit, i don't understand why the following line
registerColumnType( Types.BOOLEAN, "bit" );
was added in SQLServer2005Dialect.java
instead of SQLServerDialect.java

I am positive that this is a bug.
Can someone help confirm this ?


Top
 Profile  
 
 Post subject: Re: SQL Server 2000 Dialect in Hibernate 4.1.9
PostPosted: Fri Jan 18, 2013 5:42 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Now in that commit, i don't understand why the following line
registerColumnType( Types.BOOLEAN, "bit" );
was added in SQLServer2005Dialect.java
instead of SQLServerDialect.java

As I can remember the type bit was introduced with SQLServer2005, therefore it is declared in SQLServer2005Dialect.java.


If you are using SQL Server 2000 you must refer SQLServerDialect (and not SQLServer2005Dialect),
so you should not get affected by HHH-6420 at all.


Top
 Profile  
 
 Post subject: Re: SQL Server 2000 Dialect in Hibernate 4.1.9
PostPosted: Fri Jan 18, 2013 6:05 am 
Newbie

Joined: Fri Jan 18, 2013 4:45 am
Posts: 5
pb00067 wrote:
As I can remember the type bit was introduced with SQLServer2005, therefore it is declared in SQLServer2005Dialect.java.

Check this.
http://msdn.microsoft.com/en-us/library/aa258271(v=sql.80).aspx
Bit type was there in SQL Server 2000 as well.
I have checked hibernat 3.5.2's code and they do use Types.Bit

pb00067 wrote:
If you are using SQL Server 2000 you must refer SQLServerDialect (and not SQLServer2005Dialect),
so you should not get affected by HHH-6420 at all.

Yes i am using SQL Server 2000 but i didn't set any dialect.
I am letting Hibernate determine the dialect using StandardDialectResolver.
It figures out that i am using SQL Server 2000, sets the dialect to SQLServerDialect and fails.

If i explicitly set the dialect to SQLServer2005Dialect then it works but that's just a work around.


Top
 Profile  
 
 Post subject: Re: SQL Server 2000 Dialect in Hibernate 4.1.9
PostPosted: Fri Jan 18, 2013 6:16 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Bit type was there in SQL Server 2000 as well.


Sorry, your are right!


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