Expected Relookup Behavior?

Hi,

I’m running RC6 under RedHat9 and Windows 2000 with MySQL4 and the latest available JDBC driver from MySQL (and also using MySQL for the repository).

I’ve got some test tables and forms which use primary keys managed by MySQL via auto-increment.

In all cases, if I update a row’s data through the mysql binary or MySQL Control Center, I can’t get the change to be reflected in Servoy without switching to and back from Designer mode.

Relookup won’t show the data changes, either when used from within the Select menu, or from controller.relookup(). New records added or old deleted are reflected when using relookup, but not data changes to existing records.

Is this the intended behavior? Any solutions to see changed data, if so?

Thanks for your time.

Can anyone comment on the above, or at least their environment if they don’t see this behavior? Being able to immediately see data inserted into the database from non-Servoy source is an important item for us…

(It certainly seems that the record set or record just isn’t being reloaded as you’d expect.)

Thanks.

relookup won’t do that for you (if I am correct). Try controller.Save()

I think you’re looking for the RefreshRecordFromDatabase function (see topic http://forum.servoy.com/viewtopic.php?t … ht=refresh)

Servoy loads data into the memory. and keeps using it for better performance (This is bottom line, there is probably much more to it :-D)

Therefor, if the backend database is updated through other sources, this RefreshRecordFromDatabase-function can refresh your data.

Another way would be to flush the clients. This can be very heavy, with lowered performance for the users. So, this is not an option if the back end DB is constantly updated. Would only work if you a limited amount of batchwise updates.

Hope this helps…

Paul

To make external db changes visible in Servoy you need to flush the Servoy client caches via the server admin page

Thanks very much for your time, gentleman. I’ll look into these options re: showing externally made changes to the data in Servoy.

Cheers.

Hi,

The following two bits of code in a method attached to a button:

currentcontroller.relookup();
databaseManager.refreshRecordFromDatabase(foundset,-1);

do in fact cause externally added and deleted rows to be reflected in a Servoy form and also externally changed data to be updated.

This is from a quick MySQL test in developer and client, and the changes show up without flushing the clients caches in any way.

I didn’t see any concurrency problems with Developer, Client, and the mysql binary externally, but I’d sure like to know if there could be issues.

If this is a safe operation, it’s a tremendous capability for back-ending Web applications.

Cheers.

It is a safe operation, not sure why you are doing a relookup…