如何处理 error.VCollectionNotAvailableException:打开后集合已关闭。 (10) 在 ColdFusion 中?
我正在使用 ColdFusion 9,创建一个名为“shopColl”的真实集合。我创建一个任务计划来调用 CFM 文件,每 5 分钟对该集合建立索引。
但当我尝试刷新集合中的索引时发现此错误:
An error occurred while performing an operation in the Search Engine library.; DETAIL:The collection is not available.: com.verity.coll.VCollectionNotAvailableException: Collection down after opening. (10)
你能帮我解决这个问题吗?直到今晚之前这个过程似乎都是正确的。
下面的代码位于任务计划将在例程中调用的 CFM 文件中。
<cfprocessingdirective suppresswhitespace="true">
<cftry>
<!--- pull the content --->
<cfquery datasource="shop" name="shop.getContent">
SELECT *
FROM shop
</cfquery>
<!--- update collection --->
<cflock name="cfindex_lock" type="exclusive" timeout="30">
<cfindex collection="shopColl"
action="refresh"
type="custom"
query="shop.getContent"
key="id"
title="title"
body="title,description" >
</cflock>
<!--- Log information about document change --->
<cflog file="updateStatus" application="No"
type="information"
text="MESSAGE: Eso shop collection updated; TIME: #now()#">
<cfreturn true />
<cfcatch type="any">
<!--- Log information about error --->
<cflog file="updateStatus" application="No"
type="error"
text="MESSAGE: error in updating index -- #cfcatch.message#; DETAIL:#cfcatch.detail# TIME: #now()#">
<cfreturn false />
</cfcatch>
</cftry>
</cfprocessingdirective>
I am using ColdFusion 9, with create a verity collection name 'shopColl'. I create a task schedule to call a CFM file to do indexing this collection every 5 minutes.
but I found this error when I try to refresh index in collection:
An error occurred while performing an operation in the Search Engine library.; DETAIL:The collection is not available.: com.verity.coll.VCollectionNotAvailableException: Collection down after opening. (10)
Could you help me how to solve this? the process seems correct before until this night.
The code below, is in CFM file that task schedule will invoke in routine.
<cfprocessingdirective suppresswhitespace="true">
<cftry>
<!--- pull the content --->
<cfquery datasource="shop" name="shop.getContent">
SELECT *
FROM shop
</cfquery>
<!--- update collection --->
<cflock name="cfindex_lock" type="exclusive" timeout="30">
<cfindex collection="shopColl"
action="refresh"
type="custom"
query="shop.getContent"
key="id"
title="title"
body="title,description" >
</cflock>
<!--- Log information about document change --->
<cflog file="updateStatus" application="No"
type="information"
text="MESSAGE: Eso shop collection updated; TIME: #now()#">
<cfreturn true />
<cfcatch type="any">
<!--- Log information about error --->
<cflog file="updateStatus" application="No"
type="error"
text="MESSAGE: error in updating index -- #cfcatch.message#; DETAIL:#cfcatch.detail# TIME: #now()#">
<cfreturn false />
</cfcatch>
</cftry>
</cfprocessingdirective>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在任务之外运行它,看看需要多长时间。如果时间超过5分钟,则可能与计划任务发生死锁。
Try running it outside of being a task to see how long it takes. If it takes longer than 5 minutes, it could be deadlocking with the scheduled task.