Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Exception on CubeGrid.saveAllEdits()

    Hi all,

    We are using a cubegrid with more than 250 columns on a Rest DS. I'm sorry but I can't provide a complete standalone test case, but as I have tested extensively locally in a sample environment, I think I have most of the informations required...

    We update a cell in an area to the right of the visible screen. This cell is not loaded yet from the data source. The update is done like this:

    Code:
    String updatedValue = "" + random.nextInt(1000);
    FacetValueMap valueMap = new FacetValueMap();
    valueMap.addMapping("FirstName", "David-00");
    valueMap.addMapping("LastName", "Durand-00");
    valueMap.addMapping("Period", "P300");
    int calcRow = cubeGrid.getFacetValuesRow(valueMap);
    int calcCol = cubeGrid.getFacetValuesColumn(valueMap);
    cubeGrid.setEditValue(calcRow, calcCol, updatedValue);
    logger.info("Value set to " + updatedValue + " at " + calcRow + "/" + calcCol);
    If we scroll to view the updated data, it will be shown as updated (in blue) and a call to cubeGrid.applyChanges() will succeed and trigger the callback.

    If we don't scroll to view the updated data, the existing record is not fetched to the client from the DataSource. When calling cubeGrid.applyValues(), the remote datasource is updated consistently but the local callback is never called and we get the following exception:

    Code:
    15:26:01.652:XRP3:WARN:Log:TypeError: Cannot set property '81' of undefined
    Stack from error.stack:
        CubeGrid.setRawCellValue() @ heliosweb/sc/modules/ISC_Analytics.js:74:219
        CubeGrid.displayUpdatedDSRecord() @ heliosweb/sc/modules/ISC_Analytics.js:65:685
        ListGrid._editCompleteCallback() @ heliosweb/sc/modules/ISC_Grids.js:1738:6
        ListGrid._updateRecordReply() @ heliosweb/sc/modules/ISC_Grids.js:1728:6
        eval() @ eval at <anonymous> (http://localhost:8080/HeliosWeb/heliosweb/sc/modules/ISC_Core.js:63:76), <anonymous>:2:22
        [c]Class.fireCallback() @ heliosweb/sc/modules/ISC_Core.js:256:49
        [c]Class.fireCallback() @ heliosweb/sc/modules/ISC_Core.js:311:302
        DataSource.fireResponseCallbacks() @ heliosweb/sc/modules/ISC_DataBinding.js:639:13
        DataSource._completeResponseProcessing() @ heliosweb/sc/modules/ISC_DataBinding.js:637:6
        DataSource._handleJSONReply() @ heliosweb/sc/modules/ISC_DataBinding.js:532:6
    Can you see why this is happening ?

    It does not happen if we display the target cell before or after the call to setEditValue(...).

    Best regards,

    Browser: All (but mostly tested on Chromium)
    Execution mode: Built with Maven and deployed as a WAR, no development mode involved.
    SmartClient Version: v8.3p_2013-06-03/PowerEdition Deployment (built 2013-06-03) Note: we have the same issue with a 3 months old build, so this does not seem to be a recent regression.

    #2
    In the text I talk about cubeGrid.applyValues, it is a typo, I was talking about cubeGrid.saveAllEdits

    Comment


      #3
      The stack trace implies an error within setRawCellValue(), but from looking at the code it is not clear how this could occur - we have logic in place which should be handling the fact that the cell has never been scrolled into view.

      Can you see if you can reproduce this with a simple standalone version of your cubegrid / dataSource?
      It should be easy to build a test case using a clientOnly dataSource and using for-loops to populate the fields / test data.

      Once we have a way to reproduce the problem, we should be able to come up with a solution.
      Regards
      Isomorphic Software

      Comment


        #4
        Hi,

        I'm not really sure if a client-only data source could help reproduce the problem as it seems to be related to the fact that the record was not fetched from the server...

        Once it is loaded, visible or not, we don't get the exception.

        I'll try to create a client-only test case, but seriously doubt it'll be useful to reproduce the initial issue.

        Best regards,

        Yannick

        Comment


          #5
          A clientOnly dataSource holds its cache of records in memory, but as far as the actual databound components (such as CubeGrid) are concerned, the records still have to be "fetched" from the dataSource. If they've never been scrolled into view you should have exactly the same scenario (assuming the problem is somewhere in the CubeGrid component logic, which seems likely from your description).

          Comment


            #6
            Hi,

            It took considerable effort to reproduce it in a client-only environment but I finally made it...

            I can provide you an archive with the whole project and/or a standalone WAR archive. I can't attach it here since it is too big. I only attached the main Java files.

            *Failure scenario:*
            - Open the page, the cube grid with 300 columns is displayed
            - Click on the first button, a value of '42' is set for Alfred/Durand/P300
            - Click on the second button ("Save"). The save will fail and the callback is never invoked


            Code:
            11:43:31.417:INFO:Log:initialized
            11:43:31.696:INFO:Log:isc.Page is loaded
            11:43:31.831:INFO:Log:Starting sandbox setup
            11:43:33.747:INFO:Log:Setup done !
            11:43:48.483:MUP3:INFO:Log:Value set to 42 at 3/299
            11:43:50.026:MUP8:INFO:Log:Changes before apply: true
            11:43:50.028:MUP8:INFO:Log:Changes after apply: true
            11:43:50.033:TMR1:WARN:Log:findByKeys: dataSource 'isc_MyDS_0' does not have primary keys declared, can't find record
            11:43:50.164:TMR1:WARN:Log:TypeError: Cannot set property '3' of undefined
            Stack from error.stack:
                CubeGrid.setRawCellValue() @ heliosweb/sc/modules/ISC_Analytics.js:74:219
                CubeGrid.displayUpdatedDSRecord() @ heliosweb/sc/modules/ISC_Analytics.js:65:685
                ListGrid._editCompleteCallback() @ heliosweb/sc/modules/ISC_Grids.js:1738:6
                ListGrid._updateRecordReply() @ heliosweb/sc/modules/ISC_Grids.js:1728:6
                eval() @ eval at <anonymous> (http://localhost:8080/sandbox/heliosweb/sc/modules/ISC_Core.js:63:76), <anonymous>:2:16
                [c]Class.fireCallback() @ heliosweb/sc/modules/ISC_Core.js:256:49
                [c]Class.fireCallback() @ heliosweb/sc/modules/ISC_Core.js:311:302
                DataSource.fireResponseCallbacks() @ heliosweb/sc/modules/ISC_DataBinding.js:639:13
                DataSource._completeResponseProcessing() @ heliosweb/sc/modules/ISC_DataBinding.js:637:6
                DataSource._handleClientOnlyReply() @ heliosweb/sc/modules/ISC_DataBinding.js:523:41
            *Success scenario:*
            Same as failure, but scroll to the right edge of the cube at least once before saving. In this case logs are:
            Code:
            11:45:57.922:INFO:Log:initialized
            11:45:58.292:INFO:Log:isc.Page is loaded
            11:45:58.426:INFO:Log:Starting sandbox setup
            11:46:01.443:INFO:Log:Setup done !
            11:46:08.429:MUP3:INFO:Log:Value set to 42 at 3/299
            11:46:09.432:MUP9:INFO:Log:Changes before apply: true
            11:46:09.434:MUP9:INFO:Log:Changes after apply: true
            11:46:09.440:TMR2:WARN:Log:findByKeys: dataSource 'isc_MyDS_0' does not have primary keys declared, can't find record
            11:46:09.448:TMR2:INFO:Log:Call back return : false
            Tested with latest release of Chromium, and SmartClient Version: v8.3p_2013-06-03/PowerEdition Deployment (built 2013-06-03)
            Attached Files

            Comment


              #7
              Did you mean to include a file called sampleData.json? When I try to run the sample code, I currently get some errors reporting this file is missing.

              Comment


                #8
                Hi,

                I was not aware that you'd want to try the code as it is.

                I attached the file that I used originally to this thread.

                Best regards,

                Yannick

                Comment


                  #9
                  I just noticed that my previous attachment was refused because of the type/size of my file. So I uploaded the JSON data file to http://www.alcibiade.org/~yk/sampleData.json

                  Best regards,

                  Yannick

                  Comment


                    #10
                    We are able to load your sample code with provided json data file and are currently investigating.

                    Comment


                      #11
                      We've made fixes to SC 8.3p/SGWT 3.1p to solve this issue. They should be in the next nightly builds.

                      Comment


                        #12
                        Hi,

                        I downloaded a new 3.1p nightly build after a few days to be sure the fix is included and it now works !

                        Is this fix also available in 4.0p ? We are considering upgrading in the next months and we wouldn't want to encounter these issues again ?

                        Best regards,

                        Comment


                          #13
                          The issue was already fixed in the 4.0 branch so you should not encounter this problem there.

                          Regards
                          Isomorphic Software

                          Comment

                          Working...
                          X