2 Replies Latest reply on Oct 1, 2009 1:07 PM by theBinki

    Array collection element maximum length

    theBinki

      Hi, all.  I have a strange problem with an arraycollection.  In the application, users can create fairly large reports in a richTextArea control.  They save these in a MS SQL text field.  I can see the full text saved in the field.  There can be a lot of data stored in the field, along with all the richTextAreas HTML formatting (greatly adding to the size of the report saved).

       

      Now, when they go to re-open the report, the application does a call to get the data stored in the text field in the database.  The result handler puts this into an arraycollection.  In this case, the result field is model.arrayLoadedReport[0].ReportText.  However, the data is truncated - badly.  I did a length on the ReportText field.

       

      trace

       

       

      ("ReportText Length: "+model.arrayLoadedReport.getItemAt(0).ReportText.length);

       

      This returns exactly 64,000.  So, is there a fixed length on these arrayCollection elements?  Am I hosed on that route?  I am going to do more testing, however this is a bummer if that is the case.  Any work arounds?

       

      FYI, I did not check the length of the database field at this point, but I can actually see the data and it is all there.  The data returned and truncated is quite a bit less in this case.  I can look through the database text and see where it cuts off.

       

      Thanks.

      Gary

        • 1. Re: Array collection element maximum length
          theBinki Level 1

          I have been researching this more.  It appears that the result is returned and put into the array (the source) for the arraycollection.  As far as I can tell, this is a String.  I could not find whether or not the String class has a max limit on length.

           

          I added character counters to all of my text editors.  I can see that before I save the report it is 375,125 characters long ( editorname.htmltext.length ).  After I save it and the reload it, the character count drops to somewhere around 61,000.  (The actuall trace statement on the arraycollection for that fields length reads exactly 64,000).

           

          I am not sure how the richTextArea holds so much data (in this case, 375 thousand plus characters), the service manages to save it all to the database, but when I read it back in it seems to get cut off in the arraycollection.

           

          Ugh.  I may have to store this in chunks.  Many chunks.  These reports could, in theory, be quite large.

           

          Gary

          • 2. Re: Array collection element maximum length
            theBinki Level 1

            More research reveals...  it looks like it is the servers max return value limiting the returned dataset to 64,000 bytes.  AMF and SOAP seem to be the same.  In my case, I will probably have to break the data (the HTML formatted text) into chunks, storing it in the database in seperate entries, pulling it back out in order, reassembling and stuffing it back into the editor when needed).  I have no control over the server, so cannot change that setting.

             

            If anyone has any ideas on a better way to do this, I am open minded...  Thanks.

             

            Gary