-->
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: Infamous Turkish I problem
PostPosted: Wed Feb 08, 2012 5:29 pm 
Newbie

Joined: Wed Feb 08, 2012 4:42 pm
Posts: 2
Umbraco install problems sent me here. Below is the error line from the log:

Code:
2012-02-08 21:31:53,029 [18] ERROR NHibernate.Tool.hbm2ddl.SchemaValidator [(null)] - could not complete schema validation
NHibernate.HibernateException: Wrong column type in AttributeDateValue for column Id. Found: uniqueidentifier, Expected UNIQUEIDENTIFIER
   at NHibernate.Mapping.Table.ValidateColumns(Dialect dialect, IMapping mapping, ITableMetadata tableInfo)
   at NHibernate.Cfg.Configuration.ValidateSchema(Dialect dialect, DatabaseMetadata databaseMetadata)
   at NHibernate.Tool.hbm2ddl.SchemaValidator.Validate()


As you see UNIQUEIDENTIFIER and uniqueidentifier are not the same, even at case insensitive comparisons.

You might advice me to implement a better naming strategy but renaming the column names won't help in my case, SchemaValidator thinks uniqueidentifier and UNIQUEIDENTIFIER are two different column types because of infamous Turkish I problem: http://msdn.microsoft.com/en-us/library/ms973919.aspx#stringsinnet20_topic5

I didn't debug any source code yet. Please can someone tell me is this an NHibernate problem or Umbraco's?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Infamous Turkish I problem
PostPosted: Fri Feb 17, 2012 6:43 pm 
Newbie

Joined: Wed Feb 08, 2012 4:42 pm
Posts: 2
Hey guys I found the bug in NHibernate\Mapping\Tables.cs at line ~983:

Code:
bool typesMatch = column.GetSqlType(dialect, mapping).ToLower().StartsWith(columnInfo.TypeName.ToLower());


This line returns false in Turkish environment because of Turkish-I problem. So the line should be like below:

Code:
bool typesMatch = column.GetSqlType(dialect, mapping).ToLowerInvariant().StartsWith(columnInfo.TypeName.ToLowerInvariant());


Here is the screenshot of my debugging session:

Image


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.