Expected Relookup Behavior?

Questions and answers regarding general SQL and backend databases

Expected Relookup Behavior?

Postby JDW » Mon Feb 09, 2004 9:16 am

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.
JDW
 
Posts: 71
Joined: Sun Feb 01, 2004 1:50 am

Postby JDW » Tue Feb 10, 2004 1:45 am

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.
JDW
 
Posts: 71
Joined: Sun Feb 01, 2004 1:50 am

Postby IT2Be » Tue Feb 10, 2004 9:29 am

relookup won't do that for you (if I am correct). Try controller.Save()
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Tue Feb 10, 2004 10:43 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Jan Blok » Tue Feb 10, 2004 11:10 pm

To make external db changes visible in Servoy you need to flush the Servoy client caches via the server admin page
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby JDW » Wed Feb 11, 2004 12:26 am

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

Cheers.
JDW
 
Posts: 71
Joined: Sun Feb 01, 2004 1:50 am

Postby JDW » Thu Mar 25, 2004 4:16 am

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.
JDW
 
Posts: 71
Joined: Sun Feb 01, 2004 1:50 am

Postby Jan Blok » Thu Mar 25, 2004 11:46 am

It is a safe operation, not sure why you are doing a relookup...
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to SQL Databases

Who is online

Users browsing this forum: Google [Bot] and 28 guests

cron