function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NinoJoseNinoJose 

Inconsitent Flex Error when saving records from a Flex Application

Hi Guys,

 

Hope you can help me with my problem. I was assigned as a support to one Flex Application that unfortunately I did not create and that is already in Production. User's are complaining that they inconsistently get an error message from Flex when saving after inputting a lot of data from the Flex App. The error is:

 

[FaultEvent fault=[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: https://cs2.api.salesforce.com/services/Soap/u/11.0/00DR00000006aDz"]. URL:https://cs2.api.salesforce.com/services/Soap/u/11.0/00D00000006aDz" messageId="9314AAE6-8B25-5985-8170-8BAE4DED6A44" type="fault" bubbles=false cancelable=true eventPhase=2]

 

I looked at the code and it uses a PureMVC framework to communicate with SFDC (ofcourse with the help of the Flex Toolkit for SFDC).

 

The only weird thing that I noticed on the application is that, when the application saves the record to SFDC, and since the app saves records to multiple custom objects (Around 5 custom objects), what it does is it calls around 5 commands to save records for each type of custom objects asynchronously without waiting for the previous call to finish. Below is a pseudo-code of that is happening for the purpose of clarity:

 

 

send notification to save records to custom object 1 (Asynchronous)

send notification to save records to custom object 2 (Asynchronous)

send notification to save records to custom object 3 (Asynchronous)

send notification to save records to custom object 4 (Asynchronous)

send notification to save records to custom object 5 (Asynchronous)

 

 

So what happens here is that it calls all of the command without waiting for the others to finish. I'm thinking that the error above is causing this problem.

 

Is there a problem using the above mentioned logic to save records to salesforce using Flex? Thanks in advance who could help me out.