Coldfusion,您提供的符号[method_name]不是一个函数 [英] Coldfusion, The symbol you provided [method_name] is not a function

查看:174
本文介绍了Coldfusion,您提供的符号[method_name]不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行CF 9,0,1,274733

Running CF 9,0,1,274733

我有一个名为getGamesBetTypesID()的自定义DAO CFC。

I have a custom DAO CFC with a method called getGamesBetTypesID().

该方法由CF从以下属性隐式生成/合成:

The method is generated/synthesized implicitly by CF from the following property:

<cfproperty name="gamesBetTypesID" type="numeric" />

默认变量定义如下:

<cfset VARIABLES.gamesBetTypesID = 0 />

除此之外,没有其他VARIABLES,vars,LOCALs,ARGUMENTS或称为getGamesBetTypesID的方法。所有CFC和函数变量都有正确的作用域。

Other than that there are no other VARIABLES, vars, LOCALs, ARGUMENTS or methods called getGamesBetTypesID. All CFC and function variables are correctly scoped.

这个save()方法被调用了数千次,但是随后的错误被抛出,只有少数几次。 / p>

This save() method is called thousands of times, but the following error gets thrown randomly and only a handful of times.

Detail: The symbol you provided getGamesBetTypesID is not the name of a function. 
Message: Entity has incorrect type for being called as a function. 

以下是save()方法:

Here's the save() method:

<cffunction name="save" access="public" returntype="void" output="false">

    <cfif getGamesBetTypesID() eq 0 or getGamesBetTypesID() eq "">
        <cfset create() />
    <cfelse>
        <cfset update() />
    </cfif>

</cffunction>

当错误被抛出时,我使用
记录一个CFC元数据的转储。getMetaData(gamesBetTypesObj )。根据元数据,getGamesBetTypesID函数存在。

When the error gets thrown I log a dump of the CFCs metadata using getMetaData(gamesBetTypesObj). According to the meta data the function getGamesBetTypesID does exist.

之前有没有其他人?

提前感谢。

推荐答案

发布上面的问题后,我移除了< cfproperty name =gamesBetTypesIDtype =numeric/> 并为 VARIABLES.gamesBetTypesID 添加了显式getter和setter。

After posting the question above I removed <cfproperty name="gamesBetTypesID" type="numeric" /> and added an explicit getter and setter for VARIABLES.gamesBetTypesID.

<cffunction name="getGamesBetTypesID" output="false" access="public" returntype="numeric">
    <cfreturn VARIABLES.gamesBetTypesID />
</cffunction>

<cffunction name="setGamesBetTypesID" output="false" access="public" returntype="void">
    <cfargument name="gamesBetTypesID" required="true" type="numeric" />
    <cfset VARIABLES.gamesBetTypesID = ARGUMENTS.gamesBetTypesID />
</cffunction>

此代码已在生产中运行一周,包括周末,这是我们的忙时。在过去7天中没有抛出任何异常。以前,在忙碌的一天中最多可以抛出15个异常。

This code has been running in production for a week, including a weekend, which is our busy period. Not one exception has been thrown in the last 7 days. Previously, up to 15 exceptions were being thrown on a busy day.

这使我相信隐式访问器的生成/使用中存在一个错误< CFPROPERTY> 仅在特定情况下显示。我要使用 Adob​​e 记录错误

This leads me to believe that there is a bug in the generation/use of implicit accessors by way of <CFPROPERTY> that only appears in certain situations. I'm going to log a bug with Adobe

如果有任何进展,我会更新。

I'll update if any progress is made.

这篇关于Coldfusion,您提供的符号[method_name]不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆