• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFLock Challenge with CFObject in Application.cfc

Explorer ,
Nov 15, 2007 Nov 15, 2007

Copy link to clipboard

Copied

I occasionally get a cflock error when running an application in the morning. I moved several cfobject lines into the application.cfc onApplicationStart method. Some of the methods in the objects use cflock to read a session variable.


Here is the error:
Cannot lock session scope. Cannot use cflock to lock the application or session shared scopes without these scopes being established through the use of the cfapplication tag. To use the session scope you need to enable session management. Application and/or Session variables must also be enabled in the ColdFusion Administrator. <br>The error occurred on line 5.
TOPICS
Advanced techniques

Views

540

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 15, 2007 Nov 15, 2007

Copy link to clipboard

Copied

Have you ensured the Application variables and Session variables are enabled in the Coldfusion Administrator?.

If so, try replacing your <cfscript> block with normal <cfset> statements and see if it is working..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 15, 2007 Nov 15, 2007

Copy link to clipboard

Copied

LATEST
I think I figured this out. It appears there was a cflock in a DAO getting hit before a user was redirected to the login page.

Thanks for the help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation