128 thread safety debug
This commit is contained in:
@@ -54,7 +54,8 @@
|
||||
<cfset var out={}/>
|
||||
<cfset var maxrows=arguments.pageSize*arguments.page/>
|
||||
<cfset var startrow=arguments.pageSize*(arguments.page-1)+1/>
|
||||
|
||||
|
||||
<cfset var local={}/>
|
||||
<!--- *** обширное дублирование с instance_operation_cfs_param.cfc --->
|
||||
<cfquery name="local.qCfsParam" result="local.result">
|
||||
select
|
||||
@@ -160,7 +161,7 @@
|
||||
</cfcatch>
|
||||
</cftry>
|
||||
|
||||
<cfset local={}/>
|
||||
<cfset var local={}/>
|
||||
<cfset local.instanceOperationCfsParamUid=#createGUID()#/>
|
||||
|
||||
<cftry>
|
||||
@@ -231,7 +232,8 @@
|
||||
<!--- принадлежит ли параметр данному сервису, проверяется выше --->
|
||||
|
||||
<!--- получаем метаданные параметра --->
|
||||
<cfquery name="qSvcOperationCfsParam">
|
||||
<cfset var local={}/>
|
||||
<cfquery name="local.qSvcOperationCfsParam">
|
||||
select sop.svc_operation_cfs_param_id
|
||||
,sop.svc_operation_cfs_param
|
||||
,sop.value_list
|
||||
@@ -247,29 +249,29 @@
|
||||
where sop.svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.svcOperationCfsParamId#"/>
|
||||
</cfquery>
|
||||
|
||||
<cfif qSvcOperationCfsParam.is_required GT 0 AND len(arguments.paramValue) EQ 0>
|
||||
<cfthrow type="invalidParamValue" message="Missing required parameter (#qSvcOperationCfsParam.svc_operation_cfs_param#)"/>
|
||||
<cfelseif len(arguments.paramValue) AND NOT validateDataType(arguments.paramValue,qSvcOperationCfsParam.data_type)>
|
||||
<cfthrow type="invalidParamValue" message="Invalid format (#qSvcOperationCfsParam.svc_operation_cfs_param#)"/>
|
||||
<cfif local.qSvcOperationCfsParam.is_required GT 0 AND len(arguments.paramValue) EQ 0>
|
||||
<cfthrow type="invalidParamValue" message="Missing required parameter (#local.qSvcOperationCfsParam.svc_operation_cfs_param#)"/>
|
||||
<cfelseif len(arguments.paramValue) AND NOT validateDataType(arguments.paramValue,local.qSvcOperationCfsParam.data_type)>
|
||||
<cfthrow type="invalidParamValue" message="Invalid format (#local.qSvcOperationCfsParam.svc_operation_cfs_param#)"/>
|
||||
</cfif>
|
||||
|
||||
<cfif len(arguments.paramValue) AND listLen(qSvcOperationCfsParam.value_list) GT 0 AND NOT listFind(qSvcOperationCfsParam.value_list, arguments.paramValue)>
|
||||
<cfthrow type="invalidParamValue" message="Значение параметра #qSvcOperationCfsParam.svc_operation_cfs_param# отсутствует в списке '#qSvcOperationCfsParam.value_list#'" detail="listLen:#listLen(qSvcOperationCfsParam.value_list)#"/>
|
||||
<cfif len(arguments.paramValue) AND listLen(local.qSvcOperationCfsParam.value_list) GT 0 AND NOT listFind(local.qSvcOperationCfsParam.value_list, arguments.paramValue)>
|
||||
<cfthrow type="invalidParamValue" message="Значение параметра #local.qSvcOperationCfsParam.svc_operation_cfs_param# отсутствует в списке '#local.qSvcOperationCfsParam.value_list#'" detail="listLen:#listLen(local.qSvcOperationCfsParam.value_list)#"/>
|
||||
</cfif>
|
||||
<cfif len(arguments.paramValue) AND qSvcOperationCfsParam.maxlength GT 0 AND len(arguments.paramValue) GT qSvcOperationCfsParam.maxlength>
|
||||
<cfthrow type="invalidParamValue" message="Длина #qSvcOperationCfsParam.svc_operation_cfs_param# превышает #qSvcOperationCfsParam.maxlength#"/>
|
||||
<cfif len(arguments.paramValue) AND local.qSvcOperationCfsParam.maxlength GT 0 AND len(arguments.paramValue) GT local.qSvcOperationCfsParam.maxlength>
|
||||
<cfthrow type="invalidParamValue" message="Длина #local.qSvcOperationCfsParam.svc_operation_cfs_param# превышает #local.qSvcOperationCfsParam.maxlength#"/>
|
||||
</cfif>
|
||||
<cfif len(arguments.paramValue) AND qSvcOperationCfsParam.minlength GT 0 AND len(arguments.paramValue) LT qSvcOperationCfsParam.minlength>
|
||||
<cfthrow type="invalidParamValue" message="Длина #qSvcOperationCfsParam.svc_operation_cfs_param# меньше #qSvcOperationCfsParam.minlength#"/>
|
||||
<cfif len(arguments.paramValue) AND local.qSvcOperationCfsParam.minlength GT 0 AND len(arguments.paramValue) LT local.qSvcOperationCfsParam.minlength>
|
||||
<cfthrow type="invalidParamValue" message="Длина #local.qSvcOperationCfsParam.svc_operation_cfs_param# меньше #local.qSvcOperationCfsParam.minlength#"/>
|
||||
</cfif>
|
||||
<cfif len(arguments.paramValue) AND len(qSvcOperationCfsParam.regex) AND reFind(qSvcOperationCfsParam.regex,arguments.paramValue) EQ 0>
|
||||
<cfthrow type="invalidParamValue" message='Parameter "#qSvcOperationCfsParam.svc_operation_cfs_param#" value "#arguments.paramValue#" does not match pattern "#qSvcOperationCfsParam.regex#" '/>
|
||||
<cfif len(arguments.paramValue) AND len(local.qSvcOperationCfsParam.regex) AND reFind(local.qSvcOperationCfsParam.regex,arguments.paramValue) EQ 0>
|
||||
<cfthrow type="invalidParamValue" message='Parameter "#local.qSvcOperationCfsParam.svc_operation_cfs_param#" value "#arguments.paramValue#" does not match pattern "#local.qSvcOperationCfsParam.regex#" '/>
|
||||
</cfif>
|
||||
<cfif isNumeric(arguments.paramValue) AND isNumeric(qSvcOperationCfsParam.maxvalue) AND arguments.paramValue GT qSvcOperationCfsParam.maxvalue>
|
||||
<cfthrow type="invalidParamValue" message='Parameter "#qSvcOperationCfsParam.svc_operation_cfs_param#" value "#arguments.paramValue#" is greater than "#qSvcOperationCfsParam.maxvalue#" '/>
|
||||
<cfif isNumeric(arguments.paramValue) AND isNumeric(local.qSvcOperationCfsParam.maxvalue) AND arguments.paramValue GT local.qSvcOperationCfsParam.maxvalue>
|
||||
<cfthrow type="invalidParamValue" message='Parameter "#local.qSvcOperationCfsParam.svc_operation_cfs_param#" value "#arguments.paramValue#" is greater than "#local.qSvcOperationCfsParam.maxvalue#" '/>
|
||||
</cfif>
|
||||
<cfif isNumeric(arguments.paramValue) AND isNumeric(qSvcOperationCfsParam.minvalue) AND arguments.paramValue LT qSvcOperationCfsParam.minvalue>
|
||||
<cfthrow type="invalidParamValue" message='Parameter "#qSvcOperationCfsParam.svc_operation_cfs_param#" value "#arguments.paramValue#" is less than "#qSvcOperationCfsParam.minvalue#" '/>
|
||||
<cfif isNumeric(arguments.paramValue) AND isNumeric(local.qSvcOperationCfsParam.minvalue) AND arguments.paramValue LT local.qSvcOperationCfsParam.minvalue>
|
||||
<cfthrow type="invalidParamValue" message='Parameter "#local.qSvcOperationCfsParam.svc_operation_cfs_param#" value "#arguments.paramValue#" is less than "#local.qSvcOperationCfsParam.minvalue#" '/>
|
||||
</cfif>
|
||||
|
||||
<!--- *** интересно, как мы ухитряемся проверить уникальность параметра, если он относится к операции, а не к экземпляру. Нам-то нужна уникальность для стейта (и то, скорее, единовременная, и интересовать будут только успешные операции) --->
|
||||
@@ -294,9 +296,10 @@
|
||||
<cfargument name="instanceOperationCfsParamUid" type="guid"/>
|
||||
<!--- request.usr_id passed implicitly --->
|
||||
|
||||
<cfswitch expression=#qSvcOperationCfsParam.unique_scope#>
|
||||
<cfset var local={}/>
|
||||
<cfswitch expression=#arguments.scope#>
|
||||
<cfcase value="provider">
|
||||
<cfquery name="qUnique">
|
||||
<cfquery name="local.qUnique">
|
||||
select count(*) as cnt
|
||||
from instance_operation_cfs_param p
|
||||
join instance_operation o on (p.instance_operation_uid=o.instance_operation_uid)
|
||||
@@ -310,13 +313,13 @@
|
||||
AND (select cast(st.instance_data->>'isDeleted' as boolean) from instance_state st where st.instance_uid=e.instance_uid order by version desc limit 1) IS NOT TRUE /*ignore deleted instances*/
|
||||
</cfquery><!--- ****** здесь может таиться трудно понимаемый баг с отсутствием записи --->
|
||||
<!--- <cfdump var=#qUnique#/><cfabort/> --->
|
||||
<cfif qUnique.cnt GT 0>
|
||||
<cfif local.qUnique.cnt GT 0>
|
||||
<cfthrow type="invalidParamValue" message='#arguments.svcOperationCfsParamName# = "#arguments.paramValue#" is not unique in the provider scope'/>
|
||||
</cfif>
|
||||
</cfcase>
|
||||
|
||||
<cfcase value="tenant">
|
||||
<cfquery name="qUnique">
|
||||
<cfquery name="local.qUnique">
|
||||
select count(*) as cnt
|
||||
from instance_operation_cfs_param p
|
||||
join instance_operation o on (p.instance_operation_uid=o.instance_operation_uid)
|
||||
@@ -336,7 +339,7 @@
|
||||
AND (select cast(st.instance_data->>'isDeleted' as boolean) from instance_state st where st.instance_uid=e.instance_uid order by version desc limit 1) IS NOT TRUE /*ignore deleted instances*/
|
||||
</cfquery><!--- ****** здесь может таиться трудно понимаемый баг с отсутствием записи --->
|
||||
<!--- <cfdump var=#qUnique#/> --->
|
||||
<cfif qUnique.cnt GT 0>
|
||||
<cfif local.qUnique.cnt GT 0>
|
||||
<cfthrow type="invalidParamValue" message='#arguments.svcOperationCfsParamName# = "#arguments.paramValue#" is not unique in the tenant scope'/>
|
||||
</cfif>
|
||||
</cfcase>
|
||||
|
||||
Reference in New Issue
Block a user