databaseManager.refreshRecordFromDatabase issue

Hi there,

I have an issue using following method.

method name: refresh

databaseManager.refreshRecordFromDatabase(foundset, 1); // first record refresh in the foundset

or

databaseManager.refreshRecordFromDatabase(foundset, -1); // full foundset refresh

I am using mysql 4.1.7 on Windows 2000 (Servoy Version R2 2.1.1-build 313)

I have two fields f1, f2 in a table temp1. I have updated the f1 through MySql monitor. I used the SELECT statement to check the whether the updates are done properly and confirmed that the field f1 is updated properly.

When I clicked the button which connected to the refresh method I could not see the latest update of the data in the field f1. I have to enter a value in some other field (f2) and then click on the form and click on the refresh button again. Only now the method worked.

Note: the method seemed to work properly 1 or 2 times in the beginning and I had the above issue.

Is this a bug or am I doing something wrong?

I need to URGENTLY solve this issue since I have the same trouble in a solution which is already in the production.

Thank you very much.

Are you sure you are not in an uncomitted transaction in your database backend tool?

Yes sure. There are no uncommitted transactions in the backend tool. I never had started one.

We are unable to reproduce this, it works for us in all occasions

I have created a new test solution and in it I could not reproduce a problem. But in my real solution, I still have same problem.

Also I have another problem in myreal solution. From the developer if I go to the designer mode and go back to the browse mode the data changed by the external source are not reloaded in to servoy. Previously in this morning in the same solution I have go to designer mode twice (instead of once) to refresh the data from the database. Now how many times i did that, it would not refresh.

Any idea please? This is a real problem for me.

Thanks

You are sure you are flushing the right foundset? related data is for example is a different foundset as the “foundset” from the Form.
to refresh all order_to_orderdatails records you need todo:
databaseManager.refreshRecordFromDatabase(order_to_orderdatails , -1);

I am refreshing the correct foundset. Also I have the same issue with refreshing the related foundset. ie it only refreshes after inputting some value in a field and click on the form and click refresh button.

databaseManager.refreshRecordFromDatabase(task_group_id__task_group_to_media, -1);
databaseManager.refreshRecordFromDatabase(foundset, currentcontroller.getSelectedIndex());

Could you recreate the issue in a sample solution? or sent me the solution with the problem?

I will try to cut down the solution and send to you shortly.

It seems that the solution has got no problems. It is the table that is linked to the form makes the different. If I make the table type to MyISAM then the problem vanished. But when I change the table type to InnoDB then the problem occurred again. I have to use InnoDB since I use transcation in the application.

I am using mysql version 4.1.7-nt

Also I use the following innodb option.

innodb_file_per_table

Could you reproduce the problem in this case?

faheemhameed:
It seems that the solution has got no problems. It is the table that is linked to the form makes the different. If I make the table type to MyISAM then the problem vanished. But when I change the table type to InnoDB then the problem occurred again. I have to use InnoDB since I use transcation in the application.

If this is the case Servoy works ok, the only thing Servoy does is retrieving a row again on a database connection. So it must be related to having a transaction in Servoy or having a transaction in your tool (maybe in the tool without you knowing it).

The tool I use is the mysql monitor command prompt version. So I am pretty sure that there are no transactions at all. Also when I was testing this I had not started a transaction from within servoy too.

Could you please give a try with the innodb? I do not have any other idea to try. I have been fighting with this all yesterday.

I would be very grateful if you can help me out in this.

i just tested this on my mysql database (4.1.7) and it works perfectly if i look at record X with id = 1 and change that one from another sql tool. (Like Mysql Query manager)

Can you give me an small solution with some sample data that i can import on my mysql db?

i just tested this on my mysql database (4.1.7) and it works perfectly if i look at record X with id = 1 and change that one from another sql tool. (Like Mysql Query manager)

Can you give me an small solution with some sample data that i can import on my mysql db?