Hi, folks, I'm having an issue where attempting to query an Oracle table with a binary field causes the following error:
"Invalid destination buffer (size of 0) offset: 0" There seems to be very little information googling this message, so I wanted to ask here if anyone had encountered a similar issue. Here is the mapping we are using for the field in question, which I have verified with SqlDeveloper is an Oracle "BLOB" type, and also verified that the app works normally when the binding for this field is removed. ------------------------------------------------------------------------------ Id NUMBER(20) N IslemYapan NVARCHAR2(100) N IslemTarihi TIMESTAMP(4) N RowHashCode NCLOB Y Aktif NUMBER(1) N DepolamaUnitesiTipi NUMBER(10) N Adres NVARCHAR2(500) N AcikErisimAnahtari BLOB Y OzelErisimAnahtari BLOB Y Tanimi NVARCHAR2(255) N ------------------------------------------------------------------------------ In .NET the AcikErisimAnahtari and OzelErisimAnahtari property are byte[] array. I have included the full stack trace, with the real issue being in a nested exception below. I'm hoping someone here can tell me what I'm doing wrong, since I'm somewhat new to NHibernate. ------------------------------------------------------------------------------------------------------------------------------------------------------------ ArgumentOutOfRangeException: Invalid destination buffer (size of 0) offset: 0 Parameter name: bufferoffset] System.Data.OracleClient.OracleColumn.GetBytes(NativeBuffer_RowBuffer buffer, Int64 fieldOffset, Byte[] destinationBuffer, Int32 destinationOffset, Int32 length) +208 System.Data.OracleClient.OracleDataReader.GetBytes(Int32 i, Int64 fieldOffset, Byte[] buffer2, Int32 bufferoffset, Int32 length) +105 NHibernate.Type.AbstractBinaryType.Get(IDataReader rs, Int32 index) +67 NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name) +141 NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String[] names, ISessionImplementor session, Object owner) +31 NHibernate.Type.AbstractType.Hydrate(IDataReader rs, String[] names, ISessionImplementor session, Object owner) +19 NHibernate.Persister.Entity.AbstractEntityPersister.Hydrate(IDataReader rs, Object id, Object obj, ILoadable rootLoadable, String[][] suffixedPropertyColumns, Boolean allProperties, ISessionImplementor session) +667 NHibernate.Loader.Loader.LoadFromResultSet(IDataReader rs, Int32 i, Object obj, String instanceClass, EntityKey key, String rowIdAlias, LockMode lockMode, ILoadable rootPersister, ISessionImplementor session) +276 NHibernate.Loader.Loader.InstanceNotYetLoaded(IDataReader dr, Int32 i, ILoadable persister, EntityKey key, LockMode lockMode, String rowIdAlias, EntityKey optionalObjectKey, Object optionalObject, IList hydratedObjects, ISessionImplementor session) +135 NHibernate.Loader.Loader.GetRow(IDataReader rs, ILoadable[] persisters, EntityKey[] keys, Object optionalObject, EntityKey optionalObjectKey, LockMode[] lockModes, IList hydratedObjects, ISessionImplementor session) +287 NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, LockMode[] lockModeArray, EntityKey optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean returnProxies) +156 NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +704 NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +70 NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) +104 [ADOException: could not execute query [ select depolamaun0_."Id" as col_0_0_, depolamaun0_."Id" as Id1_61_, depolamaun0_."IslemYapan" as IslemYapan2_61_, depolamaun0_."IslemTarihi" as IslemTar3_61_, depolamaun0_."RowHashCode" as RowHashC4_61_, depolamaun0_."Aktif" as Aktif5_61_, depolamaun0_."DepolamaUnitesiTipi" as Depolama6_61_, depolamaun0_."Adres" as Adres7_61_, depolamaun0_."AcikErisimAnahtari" as AcikEris8_61_, depolamaun0_."OzelErisimAnahtari" as OzelEris9_61_, depolamaun0_."Tanimi" as Tanimi10_61_ from "DepolamaUnitesi" depolamaun0_ where depolamaun0_."Id"=:p0 ] Name:Id - Value:1 [SQL: select depolamaun0_."Id" as col_0_0_, depolamaun0_."Id" as Id1_61_, depolamaun0_."IslemYapan" as IslemYapan2_61_, depolamaun0_."IslemTarihi" as IslemTar3_61_, depolamaun0_."RowHashCode" as RowHashC4_61_, depolamaun0_."Aktif" as Aktif5_61_, depolamaun0_."DepolamaUnitesiTipi" as Depolama6_61_, depolamaun0_."Adres" as Adres7_61_, depolamaun0_."AcikErisimAnahtari" as AcikEris8_61_, depolamaun0_."OzelErisimAnahtari" as OzelEris9_61_, depolamaun0_."Tanimi" as Tanimi10_61_ from "DepolamaUnitesi" depolamaun0_ where depolamaun0_."Id"=:p0]] NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) +198 NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) +18 NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) +79 NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters) +47 NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters) +231 NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results) +353 NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results) +179 NHibernate.Impl.SessionImpl.List(String query, QueryParameters parameters) +120 NHibernate.Impl.QueryImpl.List() +112 NHibernate.Impl.AbstractQueryImpl.UniqueResult() +14 STBEbys.Data.EBYS.DepolamaUnitesi.GetSimple(Int64 Id) in D:\Projects \SanayiDYS\STBEBYS\STBEbys\STBEbys.Data\Generated\Entities \DepolamaUnitesi.cs:39 STBEbys.Business.DepolamaUnitesi.DokumanBusiness.GetFileToTempLocation(Int64 depolamaUnitesiId, String dosyaId, String fullFilePath) in D:\Projects \SanayiDYS\STBEBYS\STBEbys\STBEbys.Business\DepolamaUnitesi \DokumanBusiness.cs:983 STBEbys.Business.DepolamaUnitesi.DokumanBusiness.GetFileToTempLocationById(Int64 dokumanId, String fullFilePath) in D:\Projects\SanayiDYS\STBEBYS \STBEbys\STBEbys.Business\DepolamaUnitesi\DokumanBusiness.cs:971 STBEbys.Ext.Direct.<>c__DisplayClass30.<GetFilePathFromWCFServer>b__2f(IDokumanBusinessService p) in D:\Projects\SanayiDYS\STBEBYS\STBEbys\STBEbys.Ext.Direct \Helper.cs:392 STBEbys.Ext.Direct.Helper.Execute(CallServiceDelegate`1 pMethod) in D:\Projects\SanayiDYS\STBEBYS\STBEbys\STBEbys.Ext.Direct\Helper.cs:227 STBEbys.Ext.Direct.Helper.GetFilePathFromWCFServer(Int64 dokumanId, String fullFilePath) in D:\Projects\SanayiDYS\STBEBYS\STBEbys \STBEbys.Ext.Direct\Helper.cs:392 STBEbys.Web.FileDownloader.ProcessRequest(HttpContext context) in D: \Projects\SanayiDYS\STBEBYS\STBEbys\STBEbys.Web\FileDownloader.ashx.cs: 61 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +405 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76 -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
