//===== if sGetState = '0' then begin //===== sql_UpdateLibraryNum := 'update Library_Info set Library_Number='''+sNowLibrNumber+''' where Bar_Code='''+sBarCode+''' and Name='''+sLeechdomName+''' and PY_Code='''+ sPYCode+''' and Code='''+sCode+''' and Specifications='''+sSpec+''' and JiType='''+sJiType+''' and Measuring_Unit='''+sUnit+''' and Buy_Price='''+sBuyPrice+ ''' and Sell_Price='''+sSellPrice+''' and Valid_Until='''+sValidUntil+''' and Batch_Number='''+sBacthNumber+''' and Library_Name='''+sOutputLibrary+''''; try //===== 修改库存数量 qry_Write.sql.Clear; qry_Write.SQL.Add(sql_UpdateLibraryNum); qry_Write.ExecSQL;
// 系统延时50毫秒 delayTime(50);
// 检查数据是否写入数据库_调剂室 if not checkDataIsWriteDatabase_Library(sLeechdomName,sPYCode,sBarCode,sCode,sSpec,sJiType,sUnit,sSellPrice,sBuyPrice,sValidUntil,sBacthNumber,sOutputLibrary,sNowLibrNumber) then begin qry_Write.ExecSQL;
用户 A 执行了 代码 update 成了 一种 用户 B 执行了 代码 update 成了 另一种 这个时候 用户 A 才执行到了检查的代码。结果自然是检查失败。 即便你 A 又写了一遍。 用户 B 的检查代码发现检查失败。 B 又写了一遍。 自然对 A 来说,还是写 失败了。
----------------------------------------------
(C)(P)Flying Wang