Having sporadic and pretty serious problems with the Application scope, which I'm using to store my database's schema name.
Here's my Application.cfm:
<cfapplication name="callout"
setClientCookies = "Yes"
SessionManagement="Yes"
SessionTimeout="#CreateTimeSpan(0,1,0,0)#"
applicationTimeout = "#CreateTimeSpan(0,8,0,0)#">
<!--- Set the database table prefixes ---->
<cfif (NOT IsDefined("Application.CalloutTablePrefix")) OR (NOT IsDefined("Application.CalloutSchema"))>
<cfif (Find("dev",CGI.SERVER_NAME)) OR (Find("local",CGI.SERVER_NAME)) >
<!--- Only access database tables with CALLDEVT_ prefix for test and development. --->
<cflock scope = "Application" timeout = "15" type = "Exclusive">
<!--- The database schema used (prefix) before each database table --->
<cfscript>
Application.BridgeSchema = "B";
Application.BridgeTablePrefix = "TABLE";
Application.CalloutSchema = "CALLOUT";
Application.CalloutTablePrefix = "CALLDEVT";
</cfscript>
</cflock>
<cfelse>
<!--- Else, we're on the production server so access the live database tables (CALL_). --->
<cflock scope = "Application" timeout = "15" type = "Exclusive">
<!--- The database schema used (prefix) before each database table --->
<cfscript>
Application.BridgeSchema = "A";
Application.BridgeTablePrefix = "TABLE";
Application.CalloutSchema = "CALLOUT";
Application.CalloutTablePrefix = "CALL";
</cfscript>
</cflock>
</cfif>
</cfif>
An example query that flagged an error:
<cfquery name="Caller.ApplicationsInRota" dataSource="#request.app.dsn#">
select APPLICATION_REF As ThisApplicID, app.rota_ref As RotaID, rota_name As RotaName,
GROUP_NAME As GroupName, application As ApplicationName
from #Application.CalloutSchema#.#Application.CalloutTablePrefix#_APPLICATION app,
#Application.CalloutSchema#.#Application.CalloutTablePrefix#_GENERIC_GPS generic,
#Application.CalloutSchema#.#Application.CalloutTablePrefix#_MSTR_ROTA rot
WHERE app.rota_ref = rot.rota_ref
AND rot.ROTA2GROUP_ID = generic.GROUP_ID
...
</cfquery>
And the error message:
An error occurred while evaluating the _expression_:
#Application.CalloutSchema#
Error near line 36, column 13.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

