From: Michael D. <mik...@us...> - 2004-11-28 21:47:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3188/src/NHibernate/Impl Modified Files: ScheduledDeletion.cs ScheduledEntityAction.cs ScheduledUpdate.cs SessionImpl.cs Log Message: Added some comments about how the ScheduledActions and Versioning are working. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** SessionImpl.cs 28 Nov 2004 03:13:44 -0000 1.48 --- SessionImpl.cs 28 Nov 2004 21:47:46 -0000 1.49 *************** *** 48,52 **** //IdentityMaps are serializable in NH ! private IdentityMap entries;//key=Object, value=Entry private IdentityMap arrayHolders; //key=array, value=ArrayHolder private IdentityMap collections; //key=PersistentCollection, value=CollectionEntry --- 48,52 ---- //IdentityMaps are serializable in NH ! private IdentityMap entries;//key=Object, value=EntityEntry private IdentityMap arrayHolders; //key=array, value=ArrayHolder private IdentityMap collections; //key=PersistentCollection, value=CollectionEntry Index: ScheduledDeletion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledDeletion.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledDeletion.cs 28 Nov 2004 03:13:44 -0000 1.3 --- ScheduledDeletion.cs 28 Nov 2004 21:47:46 -0000 1.4 *************** *** 6,9 **** --- 6,12 ---- namespace NHibernate.Impl { + /// <summary> + /// A scheduled deletion of an object. + /// </summary> internal class ScheduledDeletion : ScheduledEntityAction { *************** *** 26,30 **** public override void Execute() { ! if( Persister.HasCache ) Persister.Cache.Lock( Id ); Persister.Delete( Id, _version, Instance, Session ); Session.PostDelete( Instance ); --- 29,36 ---- public override void Execute() { ! if( Persister.HasCache ) ! { ! Persister.Cache.Lock( Id ); ! } Persister.Delete( Id, _version, Instance, Session ); Session.PostDelete( Instance ); *************** *** 33,37 **** public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) Persister.Cache.Release( Id ); } } --- 39,46 ---- public override void AfterTransactionCompletion() { ! if ( Persister.HasCache ) ! { ! Persister.Cache.Release( Id ); ! } } } Index: ScheduledEntityAction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledEntityAction.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScheduledEntityAction.cs 28 Nov 2004 03:13:44 -0000 1.4 --- ScheduledEntityAction.cs 28 Nov 2004 21:47:46 -0000 1.5 *************** *** 6,10 **** namespace NHibernate.Impl { ! internal abstract class ScheduledEntityAction : SessionImpl.IExecutable { --- 6,13 ---- namespace NHibernate.Impl { ! /// <summary> ! /// The base class for a scheduled action to perform on an entity during a ! /// flush. ! /// </summary> internal abstract class ScheduledEntityAction : SessionImpl.IExecutable { *************** *** 36,39 **** --- 39,45 ---- } + /// <summary> + /// Gets the <see cref="ISessionImplementor"/> the action is executing in. + /// </summary> protected ISessionImplementor Session { *************** *** 41,44 **** --- 47,53 ---- } + /// <summary> + /// Gets the identifier of the object. + /// </summary> protected object Id { *************** *** 46,49 **** --- 55,61 ---- } + /// <summary> + /// Gets the <see cref="IClassPersister"/> that is responsible for persisting the object. + /// </summary> protected IClassPersister Persister { *************** *** 51,55 **** } ! protected object Instance { --- 63,69 ---- } ! /// <summary> ! /// Gets the object that is having the scheduled action performed against it. ! /// </summary> protected object Instance { Index: ScheduledUpdate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/ScheduledUpdate.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ScheduledUpdate.cs 28 Nov 2004 03:13:44 -0000 1.6 --- ScheduledUpdate.cs 28 Nov 2004 21:47:46 -0000 1.7 *************** *** 6,9 **** --- 6,12 ---- namespace NHibernate.Impl { + /// <summary> + /// A scheduled update of an object. + /// </summary> internal class ScheduledUpdate : ScheduledEntityAction { *************** *** 18,30 **** /// </summary> /// <param name="id">The identifier of the object.</param> ! /// <param name="fields">An object array that contains the value of each Property.</param> /// <param name="dirtyProperties">An array that contains the indexes of the dirty Properties.</param> /// <param name="lastVersion">The current version of the object.</param> /// <param name="nextVersion">The version the object should be after update.</param> /// <param name="instance">The actual object instance.</param> ! /// <param name="updatedState"></param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) : base(session, id, instance, persister) { _fields = fields; --- 21,34 ---- /// </summary> /// <param name="id">The identifier of the object.</param> ! /// <param name="fields">An array of objects that contains the value of each Property.</param> /// <param name="dirtyProperties">An array that contains the indexes of the dirty Properties.</param> /// <param name="lastVersion">The current version of the object.</param> /// <param name="nextVersion">The version the object should be after update.</param> /// <param name="instance">The actual object instance.</param> ! /// <param name="updatedState">A deep copy of the <c>fields</c> object array.</param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for the persisting the object.</param> /// <param name="session">The <see cref="ISessionImplementor"/> that the Action is occuring in.</param> ! public ScheduledUpdate(object id, object[] fields, int[] dirtyProperties, object lastVersion, object nextVersion, object instance, object[] updatedState, IClassPersister persister, ISessionImplementor session) ! : base(session, id, instance, persister) { _fields = fields; *************** *** 37,41 **** public override void Execute() { ! if ( Persister.HasCache ) Persister.Cache.Lock(Id); Persister.Update( Id, _fields, _dirtyFields, _lastVersion, Instance, Session ); Session.PostUpdate( Instance, _updatedState, _nextVersion ); --- 41,48 ---- public override void Execute() { ! if ( Persister.HasCache ) ! { ! Persister.Cache.Lock(Id); ! } Persister.Update( Id, _fields, _dirtyFields, _lastVersion, Instance, Session ); Session.PostUpdate( Instance, _updatedState, _nextVersion ); *************** *** 44,48 **** public override void AfterTransactionCompletion() { ! if( Persister.HasCache ) Persister.Cache.Release( Id) ; } } --- 51,58 ---- public override void AfterTransactionCompletion() { ! if( Persister.HasCache ) ! { ! Persister.Cache.Release( Id) ; ! } } } |