Hi all,
I’m trying to upgrade a Servoy 7.4.x system to 8.2.1 Smart Client.
When running the system we get a few errors like this one after save commands in the logic:
stopEditing max loop counter exceeded on db:/<<DATABASENAME>>/<<TABLENAME>>/5.19044; at...
I read this error message as: You have an infinite loop in your table event logic…
Somehow version 7.4 coped with this or failed silently…
Is this correct?
Any tips on how to debug these?
What does the ‘5.19044’ number mean?
Christian
Hi Christian,
What does your code do to trigger this exception?
How much records are you processing?
Hi Robert,
in my first case: I need an unsaved calendar appointment (it2be calendar bean), then I edit a person attached to the appointment, this causes an update of appointments today and in the future… which causes the person to update again ![Wink ;-)]()
I put some application.outputs() in my table events so I could see the circumstances where records are updating each other in a circular fashion. The
5.19044
above: 19044 is the PK of the record causing the loop. Not sure what the 5 is.
The simplest way of avoiding the issue is to add a check that one of the table events in the loop checks that the other record does not already have unsaved changes.
if(! note.hasChangedData()) {
note.updated_at = new Date();
}
The 5 is the length of the primary key (5 digits)…
This sounds like you have a problem in your setup. Updating record A causes updates of record B causes updates of record A causes …
This is exactly what this error is about
.
Hi Patrick,
yes, it is code going into infinite loops. What exactly happened in version 7.4? Did it just fail silently?
Or does version 8.2 do something differently?
As far as I know it “gave up” silently and now it tells you that it does. I don’t think anything fails, it’s just not ideal what you have there.
Having the code loop for no good reason leads to poor performance. The users reported that their Servoy clients were running slower than normal…
This issue is also present in 7.4.10. Anyone upgrading to the latest 7.4.x may have to make bug-fixes to table event logic.