How does registerForProxyType works

45 views
Skip to first unread message

Aldo Neto

unread,
Jun 14, 2011, 2:45:51 PM6/14/11
to google-web-toolkit
Hi,

I need to implement a dynamic table that is populated based on values of a given entity on the server by many clients simultaneously. I thought that registerForProxyType() would solve all problems of mine, but then I made some quick tests and found that it is not called when a different client performs changes to that table. Is this correct? I mean, If I have 2 persons working on the same table and one updates an entry there, should I expect to be notified on both clients? If not, is there an easy way to do that?

Thanks,
Aldo

Juan Pablo Gardella

unread,
Jun 14, 2011, 2:49:52 PM6/14/11
to google-we...@googlegroups.com
If you propage a event via eventBus don't work?

2011/6/14 Aldo Neto <tum...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Aldo Neto

unread,
Jun 14, 2011, 5:18:34 PM6/14/11
to google-we...@googlegroups.com
Hi,

Thanks for the hint, but unless I'm doing something wrong I'm still not being notified. Please note that when I say "other clients" I mean different users working on different machines accessing the same table on the same server. 

As I said, I expected that everyone would be notified when registering to registerForProxyType(). If this is not the case, the only thing that comes to my mind is to periodically request for all the entries that I'm interested. But again, I'd expect to have a way to PUSH the information I need, and this is what I'm not being able to do.

Am I missing something? Any other idea?

Thanks

Joshua Kappon

unread,
Jun 15, 2011, 2:37:50 AM6/15/11
to Google Web Toolkit
You need to cause a version change on the object to cause an update
EntityProxyChange event.
are you changing the version on the object once one of the clients is
changing it?


On Jun 15, 12:18 am, Aldo Neto <tumo...@gmail.com> wrote:
> Hi,
>
> Thanks for the hint, but unless I'm doing something wrong I'm still not
> being notified. Please note that when I say "other clients" I mean different
> users working on different machines accessing the same table on the same
> server.
>
> As I said, I expected that everyone would be notified when registering
> to registerForProxyType(). If this is not the case, the only thing that
> comes to my mind is to periodically request for all the entries that I'm
> interested. But again, I'd expect to have a way to PUSH the information I
> need, and this is what I'm not being able to do.
>
> Am I missing something? Any other idea?
>
> Thanks
>
> On Tue, Jun 14, 2011 at 3:49 PM, Juan Pablo Gardella <
>
>
>
>
>
>
>
> gardellajuanpa...@gmail.com> wrote:
> > If you propage a event via eventBus don't work?
>
> > 2011/6/14 Aldo Neto <tumo...@gmail.com>

Joshua Kappon

unread,
Jun 15, 2011, 3:28:30 AM6/15/11
to Google Web Toolkit
Disregard my last post, it doesn't work with multiple clients, only
with one.

J.Ganesan

unread,
Jun 15, 2011, 3:43:39 AM6/15/11
to Google Web Toolkit
If you are on Google App Engine Channel API is useful, perhaps. If you
are not on Google App Engine, websocket is the way to go for client-to-
client communication.

J.Ganesan
www.DataStoreGwt.com

On Jun 15, 2:18 am, Aldo Neto <tumo...@gmail.com> wrote:
> Hi,
>
> Thanks for the hint, but unless I'm doing something wrong I'm still not
> being notified. Please note that when I say "other clients" I mean different
> users working on different machines accessing the same table on the same
> server.
>
> As I said, I expected that everyone would be notified when registering
> to registerForProxyType(). If this is not the case, the only thing that
> comes to my mind is to periodically request for all the entries that I'm
> interested. But again, I'd expect to have a way to PUSH the information I
> need, and this is what I'm not being able to do.
>
> Am I missing something? Any other idea?
>
> Thanks
>
> On Tue, Jun 14, 2011 at 3:49 PM, Juan Pablo Gardella <
>
>
>
>
>
>
>
> gardellajuanpa...@gmail.com> wrote:
> > If you propage a event via eventBus don't work?
>
> > 2011/6/14 Aldo Neto <tumo...@gmail.com>

Aldo Neto

unread,
Jun 23, 2011, 8:42:43 AM6/23/11
to google-we...@googlegroups.com
Thanks you all for the help. One more question, though. I noticed that after I perform a SQL SELECT I'm receiving a EntityProxyChange event. According to Joshua in this thread "You need to cause a version change on the object to cause an update EntityProxyChange event". 

Why am I being updated just for calling a SELECT?

Thanks once again.

Thomas Broyer

unread,
Jun 23, 2011, 12:50:18 PM6/23/11
to google-we...@googlegroups.com

The enum used in EntityProxyChange.

  • A PERSIST event is fired after a proxy that was created on the client has been persisted on the server.
  • An UPDATE event is fired whenever a client encounters a proxy for the first time, or encounters a proxy whose version number has changed.
  • A DELETE event is fired after a proxy that was deleted on the client is deleted on the server as well.
Reply all
Reply to author
Forward
0 new messages