Wednesday, October 17, 2007

We all now that Flex is very much like Java. Do not forget then that in Java the expressions are evaluated from left to right. So, if you have an expression:

a = a && b;


and a is false, b will not be looked at. This is important to remember in case when b is some expression and you want it to be evaluated no matter what a is:

a = a && anImportantUpdateFunction();


If a is false, then anImportantUpdateFunction() will not be called.

Thursday, October 11, 2007

if using cfif tags, remember about the scope of defined variables (cfquery and such)
sometimes, out of the blue, you get this error message:

[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/CFIDE/test_user/returncfml.cfm"]. URL: http://localhost/CFIDE/test_user/returncfml.cfm"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at ::DirectHTTPMessageResponder/errorHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()

Flex documentation< (need link) offers no explanation, one blog gives a short description. So what is it then?
- check if you have mistyped the URL (a page, your *.cfm file, etc)
- if you are pointing to a *.cfm, check that you are using the right Data Source to access the DB
- check if the Data Source connects to the DB you need
- check that your SQL query does what it is supposed to, i.e. does not insert rows w/o specifying primary key, or adding columns that do not exist in a table, etc.