将byte []持久保存到图像数据库字段 [英] persisting byte[] to image db Field

查看:97
本文介绍了将byte []持久保存到图像数据库字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用Nfluent 1.0RTM和Linq To Nhibernate 1.0.0切换到了Nhibernate2.1.0.4000. 从那时起,在调用保存包含一个byte []数组(映射到图像数据库字段)的某个实体时,在VS2008调试器中进行调试需要花费一些时间.

I just switched to Nhibernate2.1.0.4000 with Nfluent 1.0RTM and Linq To Nhibernate 1.0.0. since then while Calling Save some entity containing an byte[] array which is mapped to an image database field, it takes ages to finish under debugging in the VS2008 debugger.

public class Appendix
{
...
  public virtual byte[] appendix { get; set; }
....
}

如果我将byte []数组设置为null,则其速度与平均值一样快.在VS 2008之外,它的速度也一如既往. 我无法将数据库字段类型从图像更改为其他类型,这是旧版数据库.

If I set the byte[] array to null its fast as aver. Also Outside VS 2008 its as fast as ever. I cannot change the database field type from image to something else, its a legacy db.

是否有NH模式如何处理(映射)图像MSSQLdatabase字段?新的NH版本有什么变化吗?

Is there a NH pattern how to handle(map) image MSSQLdatabase fields? did something change with the new NH version?

欢迎任何提示!

推荐答案

自升级以来,我没有看到byte []的变化.您如何映射该字段?

I haven't seen any changes with byte[]s in since we upgraded. How are you mapping the field?

一个类似的问题:在db中存储图像并映射它们与nhibernate

上述问题中链接的文章: http://blog.calyptus.eu/seb/2009/03/large-object-storage-for-nhibernate-and-ddd-part-1- blobs-clobs-and-xlobs/

the article linked in the above question: http://blog.calyptus.eu/seb/2009/03/large-object-storage-for-nhibernate-and-ddd-part-1-blobs-clobs-and-xlobs/

这篇关于将byte []持久保存到图像数据库字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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