我正在尝试在 Lucee 服务器中使用 ORM,但继续收到错误消息there is no Session for the datasource [mydatasource]
。数据源确实存在并且连接有效,在管理员中验证并使用 cfquery 进行了测试。
这里是application.cfc
<cfcomponent>
<cffunction name="onRequestStart" access="public" returntype="boolean" output="false">
<cfset this.datasource = "rift" />
<cfset this.ormEnabled = true />
<cfsetting showdebugoutput="false" />
<cfset this.ormsettings = { } />
<!---<cfset this.ormsettings.dbcreate = "dropcreate" />--->
<cfset this.ormsettings.logSQL = true />
<cfset ORMReload() />
<cfset testquery = ORMExecuteQuery("from test")>
<cfreturn true />
</cffunction>
</cfcomponent>