///<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); }
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; }