RequestFactory change/update polling

37 views
Skip to first unread message

Rob Whiteside

unread,
Mar 30, 2012, 4:02:51 PM3/30/12
to google-we...@googlegroups.com
Hello,

My UI on the client needs to stay in sync with the data on the server.  I am using request factory for all of this, and it's working great.  Currently, I have a timer that fires a request to the server every X seconds to get the most recent stuff.  From what I understand of requestfactory, even though my service is providing the whole object, the requestfactory magic only sends a select number of the fields over the wire.  When the client sees a change (via a new version, and thus an EntityProxyChange event) I can call "find" on that entity (using the 'with()') to get the whole structure and update my UI.

This all works great, but now I'm thinking about how to improve efficiency on the server.  My data is rather large, and spread out over several tables.  Each time my server gets a request via that timer on the client, the server code fetches all the data and builds up the entire object structure.  Then, RF Servlet discards most of that and only puts a few fields (mainly the id and version) in the response. Is there a way I can just provide the ID and Version to the RF Servlet response?  That way I can save some computation on the server by only grabbing that from the DB, rather than the whole structure.  Then, when RF deems that there actually was a change (by comparing versions), the "find" method will be used to grab everything.

I hope my question makes sense, I'm pretty new to the RequestFactory paradigm.  It's entirely possible that I'm failing to understand something basic.

Thanks!
--Rob
Reply all
Reply to author
Forward
0 new messages