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

CFC in session & locking

New Here ,
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

I was just wondering about the following:

When i create an instance of a CFC in a session scoped variable, the CF7 livedocs refence on using CFC's in persistent scopes says that we should lock "Code that calls methods of a persistent scope CFC instance that manipulate properties of the instance ".

But i am thinking about using a get and set function within the CFC that handles the locking. Whenever a method within the CFC uses any of its properties it would go through one of these functions and so proper locking is ensured. So the code that is actually calling the method does not need to be locked, so i could just say for example: session.mycfc.dosomething(a,b,c) without putting <clock> tags around that.

I think this will be perfectly fine, but would like to hear your comments and thoughts on this! Is this good practise?
TOPICS
Advanced techniques

Views

216

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
Guest
Oct 18, 2006 Oct 18, 2006

Copy link to clipboard

Copied

How will you handle timeout exceptions?

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
New Here ,
Oct 18, 2006 Oct 18, 2006

Copy link to clipboard

Copied

LATEST
What about them? I guess they can be handled in the same way as when they occur when you put the lock around the code calling the method, so in most cases i would set the throwontimeout to "yes" and let the sitewide error handler catch this. What is your idea?

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