Hi, I recently downloaded the SVN version of NHibernate and was able to build it without a problem. However, I'm running into a problem now with regard to byte[] fields that I'm storing in BLOB fields in the database. From what I can tell so far, the problem only occurs with data that was stored using a previous version of NHibernate. Namely, the release version 1.0.2.0. NHibernate appears to be using BinaryFormatter for serializing/deserializing this data. I think what's happening is that BinaryFormatter is reading data that has a dependency on NHibernate 1.0.2.0 for some reason. I don't know why this should be happening though. Has anyone else ran into this problem? I think the problem is that the public key is different on the version of NHibernate that I built versus the official one. I still don't know why the serialized data should be referencing NHibernate though. What I'm wondering is if I will run into the same problem with the next release version of NHibernate?
Hibernate version: NHibernate SVN 5/17/2006
Mapping documents:
Excluded to keep this message brief for the moment. I can post them if necessary.
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Code:
Unhandled Exception: NHibernate.LazyInitializationException: Failed to lazily in
itialize a collection ---> NHibernate.Type.SerializationException: Could not des
erialize a serializable property: ---> System.Runtime.Serialization.Serializati
onException: Unable to find assembly 'NHibernate, Version=1.0.2.0, Culture=neutr
al, PublicKeyToken=154fdcb44c4484fc'.
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssem
bly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(Binary
AssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String obje
ctName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInf
ormationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, Bi
naryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWi
thMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWi
thMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(He
aderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAp
pDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCr
ossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(Stream serializationStream)
at NHibernate.Type.SerializableType.FromBytes(Byte[] bytes) in C:\nhibernate\
trunk\nhibernate\src\NHibernate\Type\SerializableType.cs:line 144
--- End of inner exception stack trace ---
at NHibernate.Type.SerializableType.FromBytes(Byte[] bytes) in C:\nhibernate\
trunk\nhibernate\src\NHibernate\Type\SerializableType.cs:line 148
at NHibernate.Type.SerializableType.Get(IDataReader rs, Int32 index) in C:\nh
ibernate\trunk\nhibernate\src\NHibernate\Type\SerializableType.cs:line 66
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name) in C
:\nhibernate\trunk\nhibernate\src\NHibernate\Type\NullableType.cs:line 264
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String[] names, I
SessionImplementor session, Object owner) in C:\nhibernate\trunk\nhibernate\src\
NHibernate\Type\NullableType.cs:line 206
at NHibernate.Type.AbstractType.Hydrate(IDataReader rs, String[] names, ISess
ionImplementor session, Object owner) in C:\nhibernate\trunk\nhibernate\src\NHib
ernate\Type\AbstractType.cs:line 127
at NHibernate.Loader.Loader.Hydrate(IDataReader rs, Object id, Object obj, IL
oadable persister, ISessionImplementor session, String[][] suffixedPropertyColum
ns) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Loader\Loader.cs:line 1028
at NHibernate.Loader.Loader.LoadFromResultSet(IDataReader rs, Int32 i, Object
obj, Type instanceClass, EntityKey key, LockMode lockMode, ILoadable rootPersis
ter, ISessionImplementor session) in C:\nhibernate\trunk\nhibernate\src\NHiberna
te\Loader\Loader.cs:line 927
at NHibernate.Loader.Loader.InstanceNotYetLoaded(IDataReader dr, Int32 i, ILo
adable persister, EntityKey key, LockMode lockMode, EntityKey optionalObjectKey,
Object optionalObject, IList hydratedObjects, ISessionImplementor session) in C
:\nhibernate\trunk\nhibernate\src\NHibernate\Loader\Loader.cs:line 884
at NHibernate.Loader.Loader.GetRow(IDataReader rs, ILoadable[] persisters, En
tityKey[] keys, Object optionalObject, EntityKey optionalObjectKey, LockMode[] l
ockModes, IList hydratedObjects, ISessionImplementor session) in C:\nhibernate\t
runk\nhibernate\src\NHibernate\Loader\Loader.cs:line 818
at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessi
onImplementor session, QueryParameters queryParameters, LockMode[] lockModeArray
, EntityKey optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean
returnProxies) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Loader\Loader.cs
:line 294
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParamet
ers queryParameters, Boolean returnProxies) in C:\nhibernate\trunk\nhibernate\sr
c\NHibernate\Loader\Loader.cs:line 425
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionIm
plementor session, QueryParameters queryParameters, Boolean returnProxies) in C:
\nhibernate\trunk\nhibernate\src\NHibernate\Loader\Loader.cs:line 182
at NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Objec
t id, IType type) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Loader\Loader
.cs:line 1505
at NHibernate.Loader.Collection.CollectionLoader.Initialize(Object id, ISessi
onImplementor session) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Loader\C
ollection\CollectionLoader.cs:line 36
at NHibernate.Persister.Collection.AbstractCollectionPersister.Initialize(Obj
ect key, ISessionImplementor session) in C:\nhibernate\trunk\nhibernate\src\NHib
ernate\Persister\Collection\AbstractCollectionPersister.cs:line 305
at NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection col
lection, Boolean writing) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Impl\
SessionImpl.cs:line 4312
at NHibernate.Collection.AbstractPersistentCollection.Initialize(Boolean writ
ing) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Collection\AbstractPersist
entCollection.cs:line 238
--- End of inner exception stack trace ---
at NHibernate.Collection.AbstractPersistentCollection.Initialize(Boolean writ
ing) in C:\nhibernate\trunk\nhibernate\src\NHibernate\Collection\AbstractPersist
entCollection.cs:line 243
at NHibernate.Collection.AbstractPersistentCollection.Read() in C:\nhibernate
\trunk\nhibernate\src\NHibernate\Collection\AbstractPersistentCollection.cs:line
49
at NHibernate.Collection.PersistentBag.get_Count() in C:\nhibernate\trunk\nhi
bernate\src\NHibernate\Collection\PersistentBag.cs:line 339
at Forms.Persistence.Entity.Submission.ToString() in C:\Documents and Setting
s\jemiller\My Documents\Visual Studio 2005\Projects\Forms\FormsLibrary\Forms.Per
sistence.Entity\Submission.cs:line 58
at System.IO.TextWriter.WriteLine(Object value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(Object value)
at System.Console.WriteLine(Object value)
at FormsConsoleApplication.Program.Main(String[] args) in C:\Documents and Se
ttings\jemiller\My Documents\Visual Studio 2005\Projects\Forms\FormsConsoleAppli
cation\Program.cs:line 42
Name and version of the database you are using:
SQL Server 2005 SP1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: