Announcement

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

    Getting ClientMustResubmitException

    I am trying to save a set of rows from list grid. I can do a bulk update on selected rows in list Grid and then hit save which makes a RPC call using RPCManager.

    For some limited number of rows say about 400,440 the save call goes fine.
    But for a a larger number of rows ( I get error on selecting 505 rows in grid) when i hit save I get following exception

    *********************

    com.isomorphic.rpc.ClientMustResubmitException:
    at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:1180)
    at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:270)
    at com.ftid.evs.corp.webapp.hg.servlet.RPCHandler.doPost(RPCHandler.java:45)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248)
    *********************

    the code in my js file which calls save is some thing like

    Code:
    saveAllEdits: function() {
    				var lastSelectedRecord = theList.getSelectedRecord();
    				isc.showPrompt("Saving data...");
    				RPCManager.sendRequest({data: modifiedWorksheetItems, callback: "saveCallback(data,false)",
    					actionURL: rpcHandlerPath + "/rpcRequest/saveMyData?action=saveSheetItems"
    						+ "&param1=" + param1Val
    						+ "&userID=" + userID
    						+ "&param2=" + param2Val
    						+ "&GroupID=" + GroupIdVal });
    			},
    where " modifiedWorksheetItems " is a JS array containing modified rows as objects in it.

    In my server RPCHelper class we iterate through this "modifiedWorksheetItems" and create appropriate java objects and send it to our service which in turn saves all rows using some stored procedure.
    This is my RPC request handling code

    Code:
    else if("saveSheetItems".equalsIgnoreCase(action)) {
    			/*
      				get all necessary param1, param2 etc.
    			*/
    			Map dataMap = (Map)rpc.getData();
    			SortedMap<Long, Item> Items = new TreeMap<Long, Item>();
    			
    			Item item;
    			for(Object key : dataMap.keySet()) {
    				Map value = (Map)dataMap.get(key);
    				item = new Item();
    				DataTools.setProperties(value, item);								
    				if( item.getInstrumentID() != null ) {
    					items.put(item.getInstrumentID(), item);
    				}
    			}
    
    			
    			ModelClass wsModel = new ModelClass();
    			List<WorkSheetItem> result = wsModel.saveItems(items, userId, param1,param2);
    
    			logger.info("PERFORMANCE: EXITING RPCHandler action save items, DONE WITH SAVE ITEMS for " + result.size()  +
    	                StringUtil.toDuration(System.currentTimeMillis() - t1));
    			
    			rpc.send(result);
    			
    		}
    Any idea if this is a limit of data I can send in as dataMap.? or what is the problem here?

    THanks

    #2
    Whatever application server you're using has a limit on the maximum size of a POST and is dropping the request data before it reaches SmartClient's server code.

    Comment


      #3
      Thanks Isomorphic, You were right. POST size limit was issue.

      I was able to over come this issue and save successfully by "increasing the size of POST" in my application server.

      Thanks again.

      Comment


        #4
        This is in continuation of the original problem.
        Now I am able to send big data after setting new limit on POST on my App server.
        But now when i submit from GUI I get a javascript errror pop up asking me to either "Continue" or "Stop script".
        I have to click "Continue" 2-5 times depending on how big data I am sending to server and then eventually the request goes to server on last "Continue" click.
        So I think due to some limitation on size of data SmartClient can pass at one time I need to click "Continue" n number of times and as soon as all data is passed the request goes to server.

        Is there a way to avoid this too? Please suggest?

        See attached image .

        Thanks
        Himanshu
        Attached Files

        Comment


          #5
          You should first consider whether it makes sense to send so much data to server. Clearly, the user didn't input all this data, so you should be able to drastically reduce it by sending only changes.

          If you are in some kind of extremely rare use case where it does make sense to send all this data, you need to break up the processing - use Timer.setTimeout() to serialize different parts of the data, then finally send it via the RPCManager or a DataSource as an already-serialized String.

          Comment

          Working...
          X