We have tracked down the (not that obvious) cause of what we see as a bug in the databroadcast with Servoy 5.2.1 (that we found out was already present in the 5.1.x line, maybe comes from before that?)
First let me explain what we do.
We have a few ‘generic’ modules that we use in our solutions, these modules have been developed agains a very simple database.
For example we have a feedback module, which is using a feedback server having one feedback table.
To reuse this module, we simply integrate it into a new solution (checking out from a svn server), then call it’s solutionOpen method from the main solutionOpen method. Of course the module was linked to a database server which is the feedback database server, but now we want all the feedback to be saved into the feedback table of the main server of the solution, lets call it ‘maindb’.
Note that both server have a feedback table with the same structure. But of course the maindb has many more tables…
So what we do is utter a simple call to:
databaseManager.switchServer('feedback', 'maindb');
Which works perfectly well because after that call, the module is now linked to the maindb server and all insertions are made in the feedback table of the maindb server.
But what we found out is that doing so breaks databroadcast completely.
My guess is that internally Servoy is holding a memory map of the schema of the ‘feedback’ table, and tries to apply it to the ‘maindb’ server (which contains many more table), thus when it is time to fire databroadcast, it consults this map again. Since the tables from maindb were not present in the feedback server, it simply ignores them. (Actually not even the feedback table is not firing databroadcast events, but my theory still holds in that since the schema was different, databroadcast is simply broken).
Note that everything else is working perfectly (all inserts/updates/deletes are performed as usual), except that no databroadcast occurs.
We think that what we do is perfectly legal and in our view it is justified by the idea that modules are supposed to be generic and reusable part from one solution to another, thus from one database to another. This is a big problem for us as we have design all our generic modules with that idea in mind.
Please let me know it my understanding of modules is totally wrong or if this behavior is indeed a bug, in which case I will open a report on the support system (not sure how I will provide a sample solution for that though, knowing that the idea is to have 2 datasources, but I can explain this again, and this is reproducible always).
Thanks in advance for your explantations!