Hi,
This is a followup on http://www.servoy.com/forum/viewtopic.php?f=2&t=11535
We use quite a few calculations (unstored) in our solution.
Some of these had loops in them to calculate values based on 2 or 3 related tables/fields.
First of all these (heavy) calculations give errors in tableview and i created a case for this.
I noticed ( also thanks to Harjo) that these calculations also have a significant impact
on the performance of Servoy and the Oracle database.
So i changed the calculation into a Sql query and that was much faster and also gives no errors in tableview.
But using databaseManager.getDataSetByQuery in a calculation is not supported.
So i changed my calculation to use a stored function which is even faster then a sql-query.
AND it is supported in a calculation.
var args = new Array() ;
args[0] = java.sql.Types.NUMERIC ;
args[1] = inkpordkrt_id
var typesArray = new Array() ;
typesArray[0] = 1;
typesArray[1] = 0;
var proc_declaration = '{?=call get_inkorder_inkbedr_tot(?)}' ;
var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray,1) ;
return dmesp.getValue(1,1);
This al works great.
If I change one of the related table-fields (that are used in the stored function) in a child record the calculation is also updated.
But : if another user changes such a table-field of a child record the databroadcasting takes care of updating those
table-fields in the child records in my solution (on my screen), but the calculation (also on my screen) based on
the stored function is not updated.
if I do it the old-fashioned way ( looping trough foundset in calculation) the calculation does get updated if
one of the childrecords is updated by databroadcasting.
So it seems that if there are no relations / fields in the calculation pointing to the childrecords,
the calculation does nog get updated if childrecords are updated trough databroadcastring.
Is this standard behaviour or could this be a bug ?