I use a lookup field te retreive a value from a related table.
Works fine.
But when i am running the Servoy application and change the related data
outside of Servoy it will not show me the new data in Servoy when i do a
controller.relookup().
When i stop and restart the Servoy application and then do a relookup
it will show the new data.
Strange !!! does Servoy cash the related data ??? or ??
Version 3.5 rc2-build 507
Java version 1.6.0_01-b06 (Windows XP)
Database : Oracle 10gr2
Hans Nieuwenhuis:
But when i am running the Servoy application and change the related data
outside of Servoy it will not show me the new data in Servoy when i do a
controller.relookup().
When i stop and restart the Servoy application and then do a relookup
it will show the new data.
Strange !!! does Servoy cash the related data ??? or ??
Version 3.5 rc2-build 507
Java version 1.6.0_01-b06 (Windows XP)
Database : Oracle 10gr2
Yes, you have to restart Servoy if you change data with an external app.
Anyway take a look at these functions:
databaseManager.refreshRecordFromDatabase(foundset, number recordIndex)
plugins.rawSQL.flushAllClientsCache(serverName, tableName)
Nicola,
Thanks !! Works fine.
i am using : databaseManager.refreshRecordFromDatabase(foundset, number recordIndex).
This is less expensive then flushAllClientsCache, because it only works on the current client.
i am using : databaseManager.refreshRecordFromDatabase(foundset, number recordIndex).
This is less expensive then flushAllClientsCache, because it only works on the current client.
The RawSQL plugin is there for advanced use, if there is no other way…
Use “flushAllClientsCache” with care, it causes quite some overhead and therefor should just be used as a last resort…
Paul
pbakker:
i am using : databaseManager.refreshRecordFromDatabase(foundset, number recordIndex).
This is less expensive then flushAllClientsCache, because it only works on the current client.
The RawSQL plugin is there for advanced use, if there is no other way…
Use “flushAllClientsCache” with care, it causes quite some overhead and therefor should just be used as a last resort…
Paul
Yes, but if you need to broadcast the change to all open clients it’s the only way to do it.
Or is there another way?
Yes, but if you need to broadcast the change to all open clients it’s the only way to do it.
Or is there another way?
If you update something in the DB outside Servoy, or using the RawSQL plugin, this is the only way.
But, we do see people go for an update through the RawSQL plugin too quick. In most scenario’s the required updates can be done within the scope of servoy, either the foundsetUpdater, or just getting the appropriate record in the foundset and script the update.
It happens that people do not know how to do this properly and therefor just take the shortcut of writing an update statement themselfs, execute it through the RawSQL plugin and then flush allt he client caches. allthough this might seem like less work in case of complex datastructures, the time gained during development is usually lost while trying to figure out why the performance is not up to standards, because of frequent flushes.
I’m not saying this happened here, I just wanted to give a general warning about using the RawSQL plugin too quickly.
Paul
pbakker:
But, we do see people go for an update through the RawSQL plugin too quick. In most scenario’s the required updates can be done within the scope of servoy, either the foundsetUpdater, or just getting the appropriate record in the foundset and script the update.
Paul
Thanks Paul, unfortunatly this is not my case, my data is generated and handled by a Radius server so the only way to refresh is to use the flushCache, obviously I use it only if I need to broadcast the change to all open clients.
Nicola,
If you know which PK’s were inserted/updated/delete, then in Servoy 3.5 the RawSQL plugin has a new function for you: notifyDataChange.
With this new function, you can tell the server that a certain record was inserted/updated/deleted outside of the scope of Servoy. The server will then broadcast this dataChange to all clients that need it.
When you use this function, you bring down the overhead drastically. Basically, when using this feature to notify the server of a dataChange is equal to editing/inserting/deleting a record within the Servoy scope (so through the GUI or scripting).
Paul
Gorgeous!!
I will look into that!