Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8741945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:24:35+00:00 2026-06-13T11:24:35+00:00

I am placing a component in my application scope so that it is shared

  • 0

I am placing a component in my application scope so that it is shared across all requests and it includes a a cfm template:

<cfcomponent output="false">

    <cffunction name="run" output="false" returntype="void">

        <cfset var tmp = false/>

        <cftry>
            <cfinclude template="inc.cfm"/>
            <cfcatch>
                <cffile action="append"
                        file="#ExpandPath("error.log")#"
                        output="ERROR: #cfcatch.message#"/>
            </cfcatch>
        </cftry>

    </cffunction>

</cfcomponent>

The template that is being included simply creates an array and checks the array length is what it should be, if not it writes to the error.log file:

<cfset tmp = [
    "one",
    "two",
    "three"
]/>
<cfif ArrayLen(tmp) neq 3>
    <cffile action="append"
            file="#ExpandPath("error.log")#"
            output="Length = #ArrayLen(tmp)#"/>
</cfif>

If I then run a load across it (100 concurrent threads) I get the following items appearing in my error.log file…

ERROR: element at position 3 of array variable &quot;___IMPLICITARRYSTRUCTVAR0&quot; cannot be found.
Length = 0
Length = 2

Note I’m using ColdFusion 9.0.1.274733 ontop of Java 1.7.0_09. I’ve tested Railo on the same JRE and it works fine.


Additional The following also causes a problem, changing the tmp variable to a struct and adding a random item in the variables scope that is not referenced anywhere…

<cfcomponent output="false">

    <!--- 
    Some random variable that does nothing with the exception
    of being the facilitator of my eternal pain
    --->
    <cfset variables.t = {}/>

    <cffunction name="run" output="false" returntype="void">

        <cfset var tmp = {}/>

        <cftry>
            <cfinclude template="inc2.cfm"/>
            <cfcatch>
                <cffile action="append"
                        file="#ExpandPath("error.log")#"
                        output="ERROR: #cfcatch.message#"/>
            </cfcatch>
        </cftry>

    </cffunction>

</cfcomponent>

Which includes a template, very similar to the first, that looks like this…

<cfset tmp.arr = [
    "one",
    "two",
    "three"
]/>
<cfif ArrayLen(tmp.arr) neq 3>
    <cffile action="append"
            file="#ExpandPath("error.log")#"
            output="Length = #ArrayLen(tmp.arr)#"/>
</cfif>

If you remove the item in the variables scope it works fine. If you dump #variables# and #local# in the template, everything is where you would expect it to be.


(Update from comments)

I’ve since raised this issue as a bug #3352462

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:24:36+00:00Added an answer on June 13, 2026 at 11:24 am

    This is based on Peter’s / your own comments above.

    There have been / are a number of bugs with array and struct shorthand notion, and have been since CF8 introduced the syntax. Adobe’s approach to fixing ’em has been a bit like whack-a-mole rather than an effort to sort the problem out once, and properly. It looks like you’ve found another example of this. It’d be interesting to see if this still exists in CF10 though, as I know they fixed some more during its dev cycle.

    The only way around it is to not use that notation in situations in which you see these problems.

    Could you pls raise a bug for this so Adobe are aware of it?

    Also slightly noteworthy, but unrelated to your specific issue here: CF ain’t supported on Java 1.7 yet. You might wanna bear that in mind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have worked on a simple application. It application includes diffrent levels that can
When placing an icon on a page, it seems that it somehow overrode the
So we have a PHP+Zend Framework+Doctrine 1.2 application that has the following structure: Controller
I am trying to take images I am placing in a flex canvas component
I am working on a Java EE 6 application that consists of multiple components,
I have an application that loads external SWF files and plays them inside a
First of all, I am sorry that this is not a 'question that can
I am creating one application in Adobe AIR with Flex 4.6. In that, I
I managed to create an application in Blackberry that plays audio file, but it
I have an application that has a GUI and TCP server. The TCP server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.