Oracle Client Blob 10K是否受NHibernate和Mono限制? [英] Oracle Client Blob 10K Limitation with NHibernate and Mono?

查看:144
本文介绍了Oracle Client Blob 10K是否受NHibernate和Mono限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些细节可用:

NHibernate : 2.1.2.4000
Oracle Instant client : x64 11.2.0.2.0
Mono : Mono JIT compiler version 2.10.2

我目前在Oracle和Blob方面有些挣扎,仅将10K的Blob插入到数据库中.尽管这在Windows上确实有效,但在Linux上似乎有所不同.看着sql,一切似乎都很好.这是截断的sql语句.

I'm currently struggling a bit with Oracle and blobs whereby only 10K of the blob is inserted into the database. While this does work on Windows, there seems to be something different on Linux. Looking at the sql, every thing seems fine. Here is the truncated sql statement.

INSERT INTO Voters (Photo) VALUES (:p1);:p1 = 0x424DF627090000000000360000002800000090.... 

休眠映射如下所示

和如下的类

public partial class Voter : BusinessBase<long>
{
    #region Declarations
    private byte[] _photo = null;
    #endregion

    public virtual byte[] Photo
    {
        get { return _photo; }
        set { _photo = value; }
    }
}

保存投票者对象的代码如下

The code where the voter object is saved look as follows

Voter entityVoter = Voter.copyFrom(record.TRANSACTION);
IVoterManager managerVoter = ManagerFactory.Instace.GetVoterManager(managerBulkImport.Session);
managerVoter.SaveOrUpdate(entityVoter);
File.WriteAllBytes("/home/user/voter" + entityVoter.Id + ".bmp", entityVoter.Photo);

对象保存后写入磁盘的映像也正确,这使我认为问题可能出在oracle客户端上?就像我说过的那样,此代码可在Windows上正常运行,但路径自然除外.

And the image that's written to disk after the object has been save is also correct which makes me think that the problem might be with the oracle client? And as I've said, this code works on windows, except for the paths naturally.

任何帮助将不胜感激!

Any help would be greatly appreciated!

推荐答案

不幸的是,Mono Oracle提供程序已或多或少地被放弃了(就像 dotConnect for Oracle 正式支持Mono(我对此有很好的经验),并且用于Oracle的DataDirect ADO.NET数据提供程序是100%托管代码,因此从理论上讲,它也应与Mono合作.

The Mono Oracle provider is, unfortunately, more or less abandoned right now (just as the Microsoft Oracle provider whose API Mono was tracking). Since you are already paying large amounts of money for the database engine, I'd suggest spending a little bit more and getting a commercially supported Oracle ADO.Net provider. dotConnect for Oracle officially supports Mono (and I had very good experience with it), and DataDirect ADO.NET Data Provider for Oracle is 100% managed code, so it should - in theory - work with Mono as well.

这篇关于Oracle Client Blob 10K是否受NHibernate和Mono限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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