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.

<property column="LOGO" type="BinaryBlob" name="Logo" />

  In .NET the Logo property is a 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.

  -- Julian Mensch

-----------------------

[SQL: select unitinfo0_.UNITID as UNITID339_,
unitinfo0_.UNITDESCRIPTION as UNITDESC2_339_, unitinfo0_.CORPORATENAME
as CORPORAT3_339_, unitinfo0_.LOCATION as LOCATION339_,
unitinfo0_.COUNTRY as COUNTRY339_, unitinfo0_.LOGO as LOGO339_,
unitinfo0_.FILENAME as FILENAME339_, unitinfo0_.FILESIZE as
FILESIZE339_, unitinfo0_.DBID as DBID339_ from UNITINFO unitinfo0_]
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
QueryParameters queryParameters)
   at
NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor
session, QueryParameters queryParameters)
   at NHibernate.Loader.Loader.List(ISessionImplementor session,
QueryParameters queryParameters, ISet`1 querySpaces, IType[]
resultTypes)
   at
NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor
session, QueryParameters queryParameters)
   at
NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor
session, QueryParameters queryParameters)
   at NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters
queryParameters, ISessionImplementor session, IList results)
   at NHibernate.Impl.SessionImpl.List(String query, QueryParameters
queryParameters, IList results)
   at NHibernate.Impl.SessionImpl.List[T](String query,
QueryParameters parameters)
   at NHibernate.Impl.QueryImpl.List[T]()
   at Metegrity.Server.VisServer._queryData(OpContext Context, String
HQuery, String[] ParameterNames, Object[] ParameterValues, String
fieldFilter, String tableFilter, String metaFilter, Boolean singleObj,
Boolean directForm) in D:\VisionsNET\VisionsNETSrv\MainService.cs:line
497

[ Nested Exception ]
Invalid destination buffer (size of 0) offset: 0
Parameter name: bufferoffset
   at
System.Data.OracleClient.OracleColumn.GetBytes(NativeBuffer_RowBuffer
buffer, Int64 fieldOffset, Byte[] destinationBuffer, Int32
destinationOffset, Int32 length)
   at System.Data.OracleClient.OracleDataReader.GetBytes(Int32 i,
Int64 fieldOffset, Byte[] buffer2, Int32 bufferoffset, Int32 length)
   at NHibernate.Type.AbstractBinaryType.Get(IDataReader rs, Int32
index)
   at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String
name)
   at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs,
String[] names, ISessionImplementor session, Object owner)
   at NHibernate.Type.AbstractType.Hydrate(IDataReader rs, String[]
names, ISessionImplementor session, Object owner)
   at
NHibernate.Persister.Entity.AbstractEntityPersister.Hydrate(IDataReader
rs, Object id, Object obj, ILoadable rootLoadable, String[][]
suffixedPropertyColumns, Boolean allProperties, ISessionImplementor
session)
   at NHibernate.Loader.Loader.LoadFromResultSet(IDataReader rs, Int32
i, Object obj, String instanceClass, EntityKey key, String rowIdAlias,
LockMode lockMode, ILoadable rootPersister, ISessionImplementor
session)
   at NHibernate.Loader.Loader.InstanceNotYetLoaded(IDataReader dr,
Int32 i, ILoadable persister, EntityKey key, LockMode lockMode, String
rowIdAlias, EntityKey optionalObjectKey, Object optionalObject, IList
hydratedObjects, ISessionImplementor session)
   at NHibernate.Loader.Loader.GetRow(IDataReader rs, ILoadable[]
persisters, EntityKey[] keys, Object optionalObject, EntityKey
optionalObjectKey, LockMode[] lockModes, IList hydratedObjects,
ISessionImplementor session)
   at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader
resultSet, ISessionImplementor session, QueryParameters
queryParameters, LockMode[] lockModeArray, EntityKey
optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean
returnProxies)
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
QueryParameters queryParameters, Boolean returnProxies)
   at
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor
session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
QueryParameters queryParameters)

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

Reply via email to