mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:03:27 +08:00
【优化】并发下单场景用户金额变动增加事务锁的悲观锁等待模式,防止出现金额异常情况。
This commit is contained in:
@@ -300,6 +300,21 @@ namespace CoreCms.Net.Services
|
||||
return await BaseDal.QueryByClauseAsync(predicate, orderByPredicate, orderByType, blUseNoLock);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件查询数据(悲观锁等待模式)
|
||||
/// </summary>
|
||||
/// <param name="predicate">条件表达式树</param>
|
||||
/// <param name="orderByPredicate">排序字段</param>
|
||||
/// <param name="orderByType">排序顺序</param>
|
||||
/// <param name="blUseTranLock">是否使用TranLock</param>
|
||||
/// <returns></returns>
|
||||
public async Task<T> QueryByClauseWithTranLockAsync(Expression<Func<T, bool>> predicate,
|
||||
Expression<Func<T, object>> orderByPredicate, OrderByType orderByType, bool blUseTranLock = false)
|
||||
{
|
||||
return await BaseDal.QueryByClauseWithTranLockAsync(predicate, orderByPredicate, orderByType, blUseTranLock);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 写入实体数据
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user