Exemple #1
0
        /// <summary>
        /// Seal parcel after modification
        /// May call this method on parcels in either Creating or Modifying states.
        /// Bank is used to create the ReplicationVersionInfo which is depends on store/bank implementation.
        /// Parcels can replicate only within stores/technologies that have sealed them
        /// </summary>
        public void Seal(IBank bank)
        {
            if (bank == null)
            {
                throw new DistributedDataAccessException(StringConsts.ARGUMENT_ERROR + "Parcel.Seal(bank==null)");
            }

            if (m_State != ParcelState.Creating && m_State != ParcelState.Modifying)
            {
                throw new DistributedDataAccessException(StringConsts.DISTRIBUTED_DATA_PARCEL_INVALID_OPERATION_ERROR.Args("Seal", GetType().FullName, m_State));
            }

            Validate(bank);

            if (ValidationExceptions.Any())
            {
                throw ParcelSealValidationException.ForErrors(GetType().FullName, ValidationExceptions);
            }


            m_ReplicationVersionInfo = bank.GenerateReplicationVersionInfo(this);

            DoSeal(bank);

            m_State       = ParcelState.Sealed;
            m_NewlySealed = true;
        }
Exemple #2
0
            /// <summary>
            /// Seal parcel after modification
            /// May call this method on parcels in either Creating or Modifying states.
            /// Bank is used to create the ReplicationVersionInfo which is depends on store/bank implementation.
            /// Parcels can replicate only within stores/technologies that have sealed them
            /// </summary>
            public void Seal(IBank bank)
            {
               if (bank==null) 
                 throw new DistributedDataAccessException(StringConsts.ARGUMENT_ERROR+"Parcel.Seal(bank==null)"); 

               if (m_State!= ParcelState.Creating && m_State!=ParcelState.Modifying) 
                 throw new DistributedDataAccessException(StringConsts.DISTRIBUTED_DATA_PARCEL_INVALID_OPERATION_ERROR.Args("Seal", GetType().FullName, m_State) );

               Validate(bank);

               if (ValidationExceptions.Any())
                 throw ParcelSealValidationException.ForErrors(GetType().FullName, ValidationExceptions);


               m_ReplicationVersionInfo = bank.GenerateReplicationVersionInfo(this);

               DoSeal(bank);

               m_State = ParcelState.Sealed;
               m_NewlySealed = true;
            }