二进制 Blob 被截断为 8000 字节 - SQL Server 2008/varbinary(max) [英] Binary Blob truncated to 8000 bytes - SQL Server 2008 / varbinary(max)

查看:20
本文介绍了二进制 Blob 被截断为 8000 字节 - SQL Server 2008/varbinary(max)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从 Fluent Nhibernate 1.0 和 Nhibernate 2.1 升级到 pre-使用 NHibernate 3.0 GA 发布 1.x 并达到了我认为的回归,但我想听听是否确实如此.

I have upgraded from Fluent Nhibernate 1.0 with Nhibernate 2.1 to pre- release 1.x with NHibernate 3.0 GA and have hit what I think is a regression, but I want to hear if that's indeed the case.

我正在使用 SQL Server Express 2008 和 MSSQL 2008 方言,并且有一个System.Drawing.Image 类型的图像属性,我已经将它映射为这个:

I am using SQL Server Express 2008 and the MSSQL 2008 dialect and have an Image property of type System.Drawing.Image and I have mapped it like this:

Map (food => food.Image)
 .Length (int.MaxValue)
 .Nullable ();

表中的Image列的类型为varbinary(MAX).

为该属性生成的 hbm 为:

The generated hbm for the property is:

<property name="Image" type="System.Drawing.Image, System.Drawing,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   <column name="Image" length="2147483647" not-null="false" />
</property>`

但是无论我做什么,二进制 blob 都会被截断为 8000 字节当与当前的 FNH 和 NH 版本序列化时.那没用以前的版本也是如此.

However no matter what I do the binary blob is truncated to 8000 bytes when serialized with the current FNH and NH versions. That didn't used to be the case with previous versions.

为什么会发生这种情况以及如何修复/解决它的想法?

Ideas of why this is happening and how to fix/workaround it?

推荐答案

这是一个回归.我在 https://nhibernate.jira.com/browse/NH-提出了一个错误并提供了补丁2484

这篇关于二进制 Blob 被截断为 8000 字节 - SQL Server 2008/varbinary(max)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆