Databroadcast maybe unnecessary PK

Questions and answers for designing and implementing forms in Servoy

Re: Databroadcast maybe unnecessary PK

Postby stefanoni » Wed May 08, 2013 8:56 am

the request

https://support.servoy.com/browse/SVY-4492

Thanks to all for this interessting feedbacks and your time !
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: Databroadcast maybe unnecessary PK

Postby gdurniak » Wed May 08, 2013 1:00 pm

It appears that the "onDataBroadcast" Method for the Solution triggers AFTER the Found Sets are updated

If this method could override the process, we could write our own handler

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Databroadcast maybe unnecessary PK

Postby stefanoni » Wed May 08, 2013 3:35 pm

Hi,
My Focus in this tread was, to prevent receiving databroadcast for records of other tenants. I can do what ever I want in the OnDataBroadcast() right now, this is not the problem. Maybe you describe your exactly needs on an separate tread to receive mor specific answers ?

best wishes
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: Databroadcast maybe unnecessary PK

Postby gdurniak » Wed May 08, 2013 4:05 pm

Perhaps I had it backwards ...

What we need is an OnDataBroadcastReceived() Method

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Databroadcast maybe unnecessary PK

Postby gdurniak » Thu May 09, 2013 12:43 pm

I just tried it again, and OnDataBroadcast does trigger on RECEIPT of a Data Broadcast from others

The problem is, the update still happens. We need to be able to override this, so we can add our own handler

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Databroadcast maybe unnecessary PK

Postby jcompagner » Thu Aug 01, 2013 1:47 pm

gdurniak wrote:Perhaps I had it backwards ...

What we need is an OnDataBroadcastReceived() Method

greg


and that what?
If that happens we call that and we don't do anything? That would completely kill the system.
because we do many things under the hood to make sure that all the caches, all the related foundsets are up to date.
You can't do that in that method.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Databroadcast maybe unnecessary PK

Postby jcompagner » Thu Aug 01, 2013 1:52 pm

mboegem wrote:
I can't remember seeing this behaviour.
If I'm not mistaken the pk has to be in a foundset before getting it in the onDataBroadcast event.


how on earth would that work then??
If somebody updates or inserts a new record that now suddenly belongs to a related foundset that you already have loaded in?
How does that record that come into that related foundset if we don't get any event for it?

So we have to get everything of that table, else we can't make sure that all the related foundset are really in sync with the database.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Databroadcast maybe unnecessary PK

Postby gdurniak » Thu Aug 01, 2013 4:42 pm

it seems one solution would be to let us "catch" any databroadcast received, then write our own method to refresh the screens ( or do nothing )

that is not possible now ( which may be a "bug" )

please note that your current databroadcast setup DID kill my system, with a flood of activity

but if there are databroadcast updates you must do "under the hood", then we do have a problem

greg

> and then what?
If that happens we call that and we don't do anything? That would completely kill the system.
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: Databroadcast maybe unnecessary PK

Postby jcompagner » Thu Aug 01, 2013 4:50 pm

gdurniak wrote:it seems one solution would be to let us "catch" any databroadcast received, then write our own method to refresh the screens ( or do nothing )


its not about refreshing the screen for us. Its about data consistency and because of that data is updated and that will fire some events that will update the screen
But that is only a result of, not the actual thing where we need it for.

Also i think in this thread there is talk about that you get pk's that are not meant for this client anyway.
And you want to stop that. But how to do that? How do you know in the client if you get a pk that is a result of an update that you don't need that one?
Then you need first to have the full records data before you can see that it is really something for another tenant, so checking it on the client is not a good idea..
This is more like a server side filtering of that. So that the server already can decide should i send this data broadcast to this client with that clientid.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Databroadcast maybe unnecessary PK

Postby gdurniak » Thu Aug 01, 2013 5:11 pm

In my solution, every user updates their own set of records, by selecting a global job number

it seems checking a databroadcast received on the client to see if the PK ( or job number ) is in use would be less overhead

greg

> Also i think in this thread there is talk about that you get pk's that are not meant for this client anyway.
And you want to stop that. But how to do that?
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

interesting find/search not same as addFoundSetFilterParam ?

Postby stefanoni » Fri Nov 29, 2013 6:21 pm

When the cracks talk contrary like this...
mboegem wrote:
pbakker wrote:Yes, this is expected: DataBroadcast works on table level: if your client has a foundset in memory based on table x, then it will receive databroadcasts events for all create/update/delete activity in that table.


I can't remember seeing this behaviour.
If I'm not mistaken the pk has to be in a foundset before getting it in the onDataBroadcast event.


... I just start wondering :-) and test and try again...

maybe this makes it more clear: The databroadcast indeed looks, if the pk is in my foundset, but in this specific situation:

The difference to my first post is:
- I use servoy version 7.3. ( don't know if matters)
- I use a related foundset to filter the tenant (on the left side is a global variable with the tenant key)
- I use find/search instead of .addFoundSetFilterParam()


In this test-case I had following situation:
- two webclient-session (chrom / firefox)
- against a servoyserver (on 2008) over the internet,
- looking at the same table, same tenant (filtered by related foundset with tenant-key on the left side),
- but with a different view-range of the rows in the table (find/search shows different records)
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: Databroadcast maybe unnecessary PK

Postby jcompagner » Sun Dec 01, 2013 12:38 pm

it simple, if a table is touched by a client (it did a query on it, got some records)
then it will start receiving databroadcasts for that table.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Previous

Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests

cron