Yes. Yes.

*I* know this.. just try to convince management... :oP

Figured I would check it out anyway - I mean, you have to work with the
tools you have, you know?

I ended up playing it out, and it made no sense - 

Running CFMX 6.0 Pro with Oracle 9i over the Oracle 9i Client ODBC driver.

Had a CFC which called a stored proc like so:

<cffuntion ...>
   <cfset var qMyQuery = "">

   <cfstoredproc ...>
             <cfprocresult name="qMyQuery">
   </cfstoredproc>


   <cfreturn doStuffToQuery(qMyQuery)>
</cffuntion>

The weird thing was - if I had multiple threads hitting the CFC function at
once, the 'var qMyQuery' would overwrite the previous call - so qMyQuery
would no longer be a query, it would be a string.

I found if I DIDN'T declare the variable local, then the qMyQuery would be
thread safe, and not overwrite the value when threads collided.

Totally crazy, but I got it out in the end.

And to reiterate - I would love to move all the stuff up to 6.1 - however
that might "change stuff" and things could go "bad" :oP

Who knows... maybe I can try and convince them it was their idea at some
point...

Mark



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sean A
Corfield
Sent: Friday, 5 March 2004 5:42 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Is 'var' in CFCs in MX 6.0 thread safe?

On Mar 4, 2004, at 7:49 PM, Mark M wrote:
> Running CFMX 6.0.

Upgrade to CFMX 6.1.

> Using the 'var' keywork in my CFC funtions to declare variables as 
> local - but I've got some weird threading issues popping up.

Well, "variables" scope just plain doesn't work in 6.0. I don't know 
how well 'var' worked in 6.0. You really need to upgrade to 6.1. Apart 
from the bug fixes, you'll get huge performance improvements.

Regards,
Sean


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004





---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to