Oracle Client Blob 10K Limitation with NHibernate and Mono?

☆樱花仙子☆ 提交于 2019-12-12 01:53:53

问题


Some details off hand:

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

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.... 

The hibernate mapping look like follows

and the class as follows

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);

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!


回答1:


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.



来源:https://stackoverflow.com/questions/7119976/oracle-client-blob-10k-limitation-with-nhibernate-and-mono

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!