Oracle Client Blob 10K Limitation with NHibernate and Mono?
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.W开发者_JAVA技巧riteAllBytes("/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!
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.
精彩评论