I gave up on what I was doing back a couple months ago, which was attempting to
provide a server-wide thread-safe service to the same com object. However I'm
running into a memory problem now in another process that uses the com object,
and it may be the source of my problem though I can't say for sure.
Here is a function that uses the com object in question. I have dumped
variables scope before and after hitting this function and as I described
before, the actually values of of arguments to setField are saved into
variables scoope. If I have URL or FORM variables with the same name as the com
object fields errors occurs. It seems like the com object is making ambiguous
calls on ColdFusion variables, resulting in stuff being set in variables scope
and form/url variables causing problem. Just seems crazy to me that this would
be possible but I know very little about com objects.
<cffunction name="zipSearch">
<cfargument
name="obj"
required="true"
hint="address matching com object that has already been
initialized">
<cfargument
name="addressInfo"
type="struct"
required="true">
<cfargument
name="updateAddress"
required="false"
default="false"
hint="whether to return corrected street address information">
<cfset var returnAddressInfo = duplicate(arguments.addressInfo)>
<cfset arguments.obj.clearBuffers()>
<!--- set input field values --->
<cfset arguments.obj.setField("street",arguments.addressInfo.street)>
<cfset arguments.obj.setField("street2",arguments.addressInfo.street2)>
<cfset arguments.obj.setField("city",arguments.addressInfo.city)>
<cfset arguments.obj.setField("state",arguments.addressInfo.state)>
<cfif len(arguments.addressInfo.zip)>
<cfset arguments.obj.setField("zip",arguments.addressInfo.zip)>
</cfif>
<cfset arguments.obj.lookup()>
<!--- retrieve info after look up --->
<cfif arguments.updateAddress>
<!--- overwrite original info --->
<cfset returnAddressInfo.street =
arguments.obj.getField("street")><br />
<cfset returnAddressInfo.street2 =
arguments.obj.getField("street2")>
<cfset returnAddressInfo.city = arguments.obj.getField("city")>
<cfset returnAddressInfo.state =
arguments.obj.getField("state")>
</cfif>
<cfset returnAddressInfo.zip5 = arguments.obj.getField("zip")>
<cfset returnAddressInfo.plus4 = arguments.obj.getField("plus4")>
<cfif len(returnAddressInfo.plus4) eq 4>
<cfset returnAddressInfo.zip = arguments.obj.getField("zip") &
'-' & arguments.obj.getField("plus4")>
<cfelse>
<cfset returnAddressInfo.zip = arguments.obj.getField("zip")>
</cfif>
<cfset returnAddressInfo.errorCode =
arguments.obj.getField("errorCode")>
<cfset returnAddressInfo.errorMessage =
arguments.obj.getField("errorMsg")>
<cfreturn returnAddressInfo>
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307439
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4