Page 1 of 1

Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Mon Nov 06, 2017 12:37 pm
by swingman
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:

Code: Select all
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

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Mon Nov 06, 2017 3:54 pm
by ROCLASI
Hi Christian,

What does your code do to trigger this exception?
How much records are you processing?

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Mon Nov 06, 2017 4:30 pm
by swingman
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 ;-)

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
Code: Select all
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.

Code: Select all
if(! note.hasChangedData()) {
    note.updated_at = new Date();
}

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Mon Nov 06, 2017 4:38 pm
by patrick
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 ;-).

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Mon Nov 06, 2017 10:50 pm
by swingman
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?

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Tue Nov 07, 2017 11:09 am
by patrick
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.

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Tue Nov 07, 2017 11:40 am
by swingman
Having the code loop for no good reason leads to poor performance. The users reported that their Servoy clients were running slower than normal...

Re: Servoy 8.2 stopEditing max loop counter exceeded on...

PostPosted: Fri Jan 05, 2018 12:12 pm
by swingman
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.