Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30719/src/NHibernate/Collection
Modified Files:
PersistentCollection.cs
Log Message:
Renamed PersistentCollection.ForceLoad to ForceInitialization, in accordance with H2.1
Added non-lazy collections handling which fixed a bug when non-lazy collections didn't initialize.
Index: PersistentCollection.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/PersistentCollection.cs,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** PersistentCollection.cs 7 Feb 2005 01:34:40 -0000 1.20
--- PersistentCollection.cs 16 Feb 2005 20:14:16 -0000 1.21
***************
*** 485,494 ****
/// <summary>
! /// Default behavior is to call Read; will be overridden in deep lazy collections
/// </summary>
! /// TODO: H2.0.3 declares this as final
! public void ForceLoad()
{
! Read();
}
--- 485,500 ----
/// <summary>
! /// To be called internally by the session, forcing
! /// immediate initalization.
/// </summary>
! /// <remarks>
! /// This method is similar to <see cref="Initialize" />, except that different exceptions are thrown.
! /// </remarks>
! public void ForceInitialization()
{
! if( initializing ) throw new AssertionFailure("force initialize loading collection");
! if( session == null ) throw new HibernateException("collection is not associated with any session");
! if( !session.IsConnected ) throw new HibernateException("disconnected session");
! if( !initialized ) session.InitializeCollection(this, false);
}
|