--=====================_184807419==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Right. This is what Allaire recommends in "ColdFusion Best Practices"
<cfquery name="variables.qUser" datasource="#request.dsn#">
SELECT FirstName, LastName
FROM Users
WHERE UserID = #request.UserID#
</cfquery>
<cflock scope="application" timeout="2" type="exclusive">
<cfset application.qUser = variables.qUser>
</cflock>
at http://www.allaire.com/handlers/index.cfm?id=17318&method=full
But for Structures, this was thrashed out recently in the Fusebox list. I
thought the consensus there was not to bother with the additional step of
copying the structures, and use something like the following in
qry_globals.cfm or Application.cfm:
<cflock scope="Application" type="ReadOnly" ...>
<CFSET Init = (NOT isDefined("Application.MyStruct") OR Not
isStruct(Application.MyStruct))>
</cflock>
<CFIF Init>
<cflock scope="Application" type="exclusive" ...>
<CFSET Application.MyStruct = StructNew()>
...read data here into Application.MyStruct for some
time....
</cflock>
</CFIF>
(See the posting by BOROVOY on 29 Aug 2000)
best, paul
At 09:29 PM 9/1/00 -0400, you wrote:
>At 01:48 PM 9/1/2000 -0400, Peter Theobald wrote:
> >Paul, why did you set the data in a temporary structure, then copy it to
>the application structure?
> >Did you intend to put a lock around the application structure?
>
>I don't know about Paul, but I generally build structures in local scope
>and then copy them to application (or session) scope with a single cflock
>for the copy, instead of locking the entire process. Particularly if I'm
>initializing a bunch of structures, I'll build them all and copy them all
>under one cflock.
>
>Sharon
Paul Smith, Web/Database Droid
A: SupportNet, Inc, 3871 Piedmont Ave, Oakland, CA 94611
P: (510) 763-2358
C: (510) 205-6755
F: (510) 763-2370
E: [EMAIL PROTECTED]
W: http://www.support.net
--=====================_184807419==_.ALT
Content-Type: text/html; charset="us-ascii"
<html>
Right. This is what Allaire recommends in "ColdFusion Best
Practices"<br>
<br>
<cfquery name="variables.qUser"
datasource="#request.dsn#"><br>
<x-tab> </x-tab>SELECT
FirstName, LastName<br>
<x-tab> </x-tab>FROM
Users<br>
<x-tab> </x-tab>WHERE
UserID = #request.UserID#<br>
</cfquery><br>
<cflock scope="application" timeout="2"
type="exclusive"><br>
<x-tab> </x-tab><cfset
application.qUser = variables.qUser><br>
</cflock><br>
<br>
at
<a href="http://www.allaire.com/handlers/index.cfm?id=17318&method=full"
eudora="autourl">http://www.allaire.com/handlers/index.cfm?id=17318&method=full</a><br>
<br>
But for Structures, this was thrashed out recently in the Fusebox
list. I thought the consensus there was not to bother with the
additional step of copying the structures, and use something like the
following in qry_globals.cfm or Application.cfm:<br>
<br>
<cflock scope="Application" type="ReadOnly"
...> <br>
<CFSET Init = (NOT isDefined("Application.MyStruct") OR Not
<br>
isStruct(Application.MyStruct))> <br>
</cflock> <br>
<CFIF Init> <br>
<cflock scope="Application" type="exclusive"
...> <br>
<CFSET Application.MyStruct = StructNew()> <br>
...read data here into Application.MyStruct for some <br>
time.... <br>
</cflock> <br>
</CFIF><br>
<br>
(See the posting by BOROVOY on 29 Aug 2000)<br>
<br>
best, paul<br>
<br>
At 09:29 PM 9/1/00 -0400, you wrote:<br>
<blockquote type=cite cite>At 01:48 PM 9/1/2000 -0400, Peter Theobald
wrote:<br>
>Paul, why did you set the data in a temporary structure, then copy it
to<br>
the application structure?<br>
>Did you intend to put a lock around the application structure?<br>
<br>
I don't know about Paul, but I generally build structures in local
scope<br>
and then copy them to application (or session) scope with a single
cflock<br>
for the copy, instead of locking the entire process. Particularly
if I'm<br>
initializing a bunch of structures, I'll build them all and copy them
all<br>
under one cflock.<br>
<br>
Sharon<br>
</blockquote><br>
<br>
<br>
<br>
Paul Smith, Web/Database Droid <br>
A: SupportNet, Inc, 3871 Piedmont Ave, Oakland, CA 94611 <br>
P: (510) 763-2358 <br>
C: (510) 205-6755<br>
F: (510) 763-2370<br>
E: [EMAIL PROTECTED]<br>
W:
<a href="http://www.support.net/" eudora="autourl"><font
color="#0000FF"><u>http://www.support.net</a><br>
</font></u></html>
--=====================_184807419==_.ALT--
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.