예제 #1
0
 ///<summary>
 /// Creates a number generator with Pesssimistic locking.
 ///</summary>
 ///<param name="numberType"></param>
 ///<param name="lockDurationInMinutes"></param>
 public NumberGeneratorPessimisticLocking(string numberType, int lockDurationInMinutes)
 {
     LockDurationInMinutes = lockDurationInMinutes;
     if (!ClassDef.ClassDefs.Contains(typeof(BOSequenceNumberLocking)))
     {
         BOSequenceNumberLocking.LoadNumberGenClassDef();
     }
     _boSequenceNumber = LoadSequenceNumber(numberType);
 }
	    ///<summary>
	    /// Creates a number generator with Pesssimistic locking.
	    ///</summary>
	    ///<param name="numberType"></param>
	    ///<param name="lockDurationInMinutes"></param>
	    public NumberGeneratorPessimisticLocking(string numberType, int lockDurationInMinutes)
		{
	        LockDurationInMinutes = lockDurationInMinutes;
	        if (!ClassDef.ClassDefs.Contains(typeof(BOSequenceNumberLocking)))
			{
				BOSequenceNumberLocking.LoadNumberGenClassDef();
			}
			_boSequenceNumber = LoadSequenceNumber(numberType);
		}
예제 #3
0
        private BOSequenceNumberLocking CreateSequenceForType(string numberType)
        {
            var sequenceBOSequenceNumber = new BOSequenceNumberLocking(LockDurationInMinutes)
            {
                NumberType = numberType, SequenceNumber = 0
            };

            sequenceBOSequenceNumber.Save();
            return(sequenceBOSequenceNumber);
        }
		private BOSequenceNumberLocking CreateSequenceForType(string numberType)
		{
            var sequenceBOSequenceNumber = new BOSequenceNumberLocking(LockDurationInMinutes) { NumberType = numberType, SequenceNumber = 0};
			sequenceBOSequenceNumber.Save();
			return sequenceBOSequenceNumber;
		}