session.foo = structNew();
session.foo.abc = somethingElse;
session.foo.xyz = createObject(...);
// ...
especially if you're looping, creating objects or doing any time-consuming operations, you should either lock it, or, better yet, do this:
var foo = structNew();
foo.abc = somethingElse;
foo.xyz = createObject(...);
// ...
session.foo=foo;
And you still may want to lock that last line, though the need to do so has very greatly decreased.
-nathan strutz
http://www.dopefly.com/
On 4/28/06, Kadrioski, Darin <
[EMAIL PROTECTED]> wrote:
I would wrap a lock around that set ... overkill?_______________________________________
Darin Kadrioski
Software Engineer
PhotoTLC, Inc.
3925 Cypress Drive
Petaluma, CA 94954[EMAIL PROTECTED]
(707) 241-7177
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Daniel Roberts
Sent: Thursday, April 27, 2006 8:03 PM
To: [email protected]
Subject: Re: [CFCDev] session scope in onRequestStart ?yep, welcome to coldfusion
On 4/27/06, Jim Flannery <[EMAIL PROTECTED]> wrote:Doing my first application using application.cfc.
Is this "safe"?
<cffunction name="onRequestStart" returntype="void">
<cfargument name="request" required="true">
<cfset session.foo = "bar">
</cffunction>
(I mean, I don't see any way to "var" the session, nor a way to pass
the user's session in. Is CF guaranteed to know what session the
request that onRequestStart is starting belongs to? What I'm actually
doing in that function is working fine on my dev machine with me as a
single user but I'm concerned about going to production.)
--
Jim Flannery
[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
