Announcement

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

    A single DMI update call for sendQueue

    I have a situation where I update several records (n records) at once and send some kind of email summarizing the update process. The problem is my update method on the dmi is called (n times) which results to n emails. I searched this forum about how I can perform a bulk update with only one call to the DMI but to no avail.
    Code:
    ...
    recordsList.setUpdateOperation("updatereviewdata");
                        RPCManager.startQueue();
                        for (int rowNum : recordsList.getAllEditRows())
                        {
                        	recordsList.getDataSource().updateData(recordsList.getEditedRecord(rowNum));
                                    
                        }
                        recordsList.saveAllEdits();
                        RPCManager.sendQueue();
    Any advice will be highly appreciated.

    #2
    Funny, I've just been dealing with this kind of thing today. Take a look at http://www.smartclient.com/smartgwte...etionCallback)

    Comment


      #3
      To clarify, you can use that callback to set up mail sending that happens at the end of all operations completing successfully. So you can have your update operations register such a callback and set a dirty flag as a servletRequest attribute to avoid it happening twice or more for a given queue.

      Note also that aside from using transaction chaining expressions (in Power) there are also APIs on RPCManager that give you access to the responses of completed requests (getResponse() et al).

      Comment

      Working...
      X