NHIBERNATE, MYSQL and GUIDS

I have a view that flattens the hierarchy of 4 tables to display as a report. In the view, it contains the primary key (Guid) of each table and some display data. < p>

The problem is that guids are returned as varbinary(16) instead of binary(16), so nhibernate will throw an error. This seems to be the same to me but maybe I am missing something .

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

I Tried to add Respect Binary Flags = true; for the configuration string, it seems that everything you do will affect whether the regular class is valid.

This makes me sad. I will restore the primary key to Integers as a last resort .

This is a bug in the Mysql .net connector, please check this bug report for More detailed information
http://bugs.mysql.com/bug.php?id=52747

Update: After version 6.1.1, just use BINARY(16) as Storage type, you should add “old guids = true” to the connection string. Otherwise, you should use CHAR(36)

I have a view that combines 4 tables The level is flattened to display as a report. In the view, it contains the primary key (Guid) of each table and some display data.

The problem is that guids use varbinary(16) instead of binary (16) is returned, so nhibernate will throw an error. This seems to be the same to me but maybe I missed something.

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

I tried adding Respect Binary Flags = true; For the configuration string, it seems that everything you do will affect whether the regular class is valid.

This makes me sad. I will restore the primary key to Integers as a last resort.

This is a bug in the Mysql .net connector, please check this bug report for more details
http://bugs.mysql.com/bug.php? id=52747

Update: After version 6.1.1, as long as you use BINARY(16) as the storage type, you should add “old guids = true” to the connection string. Otherwise, you should Use CHAR(36)

Leave a Comment

Your email address will not be published.