From: Michael D. <mik...@us...> - 2004-07-06 04:35:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11724/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Fixed EvictCollections method to handle when the parameter object[] values contains a null value in one of the indexes. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** SessionImpl.cs 5 Jul 2004 20:34:21 -0000 1.31 --- SessionImpl.cs 6 Jul 2004 04:35:22 -0000 1.32 *************** *** 3621,3641 **** /// <param name="values"></param> /// <param name="types"></param> ! private void EvictCollections(Object[] values, IType[] types) { ! for ( int i=0; i<types.Length; i++ ) { ! if ( types[i].IsPersistentCollectionType ) { object pc=null; ! if ( ( (PersistentCollectionType) types[i] ).IsArrayType ) { pc = arrayHolders[ values[i] ]; arrayHolders.Remove( values[i] ); } ! else if ( values[i] is PersistentCollection ) { pc = values[i]; } ! if (pc!=null) { if ( ( (PersistentCollection) pc ).UnsetSession(this) ) collections.Remove(pc); } } ! else if ( types[i].IsComponentType ) { IAbstractComponentType actype = (IAbstractComponentType) types[i]; EvictCollections( --- 3621,3652 ---- /// <param name="values"></param> /// <param name="types"></param> ! private void EvictCollections(Object[] values, IType[] types) ! { ! for ( int i=0; i<types.Length; i++ ) ! { ! if( values[i]==null) ! { ! // do nothing ! } ! else if ( types[i].IsPersistentCollectionType ) ! { object pc=null; ! if ( ( (PersistentCollectionType) types[i] ).IsArrayType ) ! { pc = arrayHolders[ values[i] ]; arrayHolders.Remove( values[i] ); } ! else if ( values[i] is PersistentCollection ) ! { pc = values[i]; } ! if (pc!=null) ! { if ( ( (PersistentCollection) pc ).UnsetSession(this) ) collections.Remove(pc); } } ! else if ( types[i].IsComponentType ) ! { IAbstractComponentType actype = (IAbstractComponentType) types[i]; EvictCollections( |