互斥锁id可以查询表 T_BAS_DataUpdateMutex
select * from T_BAS_DataUpdateMutex
没有用户参数时可使用以下
//增加网络互斥 IMutexServiceControl iMutex = MutexServiceControlFactory.getLocalInstance(ctx); String billId = null; try { IRowSet rowSet = DbUtil.executeQuery(ctx, sql); while(rowSet.next()) { boolean mutexLock = false; //设置为关闭状态 billId = rowSet.getString("FID");//单据id //增加互斥锁 if(iMutex.requestObjIDForUpdate(billId)){ mutexLock =true; }else{ continue; } try { String rst= _pushJZTERP(ctx,new ObjectUuidPK(billId)); } finally{ //释放互斥锁 if(mutexLock){ iMutex.releaseObjIDForUpdate(billId); } } }
当有用户参数时,可用如下
IMutexServiceControl mutex = MutexServiceControlFactory.getRemoteInstance(); UserInfo user = null; // 请求锁有用户 String billId = null; // 要锁定/解锁的单据Id // 请求锁定 mutex.requestObjIDForUpdate(billId, user.getString("id")); // 解除锁 mutex.releaseObjIDForUpdate(billId);
标签:String,billId,查询,互斥,EAS,null,iMutex,id From: https://www.cnblogs.com/ketoli/p/17296187.html