Servoy 3.x - java.util.ConcurrentModificationException

Having a problem with 3.x (Didn’t happen in 2.x) when looping 100 plus records:

Method is:

var count = databaseManager.getFoundSetCount(foundset);

for ( var i = 1 ; i <= count; i++ )
{
controller.setSelectedIndex(i);
}

Stops on: controller.setSelectedIndex(i);

Error: java.util.ConcurrentModificationException

System setup is currently:

Servoy Version 3.1 beta3-build 402
Java version 1.5.0_06-64 (Mac OS X)

MySQL 5.0.27

mysql-connector-java-5.0.4-bin.jar (tried older one also)

Any Ideas? I didn’t have this problem in Servoy 2.x.

Thanks

No idea.

Hopefully you realize there are smarter way to do this btw.
Have a look on the forum (search for looping or other keywords).

I was not able to reproduce this, a method with the loop you described worked fine on my system.
Please create a support case at: http://crm.servoy.com/servoy-webclient/ … oy_support

Please supply a small test solution that shows the problem

Error: java.util.ConcurrentModificationException

a “shot in the dark”:

might this have something to do with autosave being on or off and/or with multi-user issues? What error would be thrown if the record were in use on another machine? Or if testing in Client on one’s own computer while that record is in use (“open”, “locked by”) Developer on the same box, even?

kazar

Hmm, talking about shots in the dark?

you set the selected index.
What about onrecordselection etc. events attached.
When they are there it is almost certain they cause it.
Simply disable them to test and you will know…

IT2Be:
Hmm, talking about shots in the dark?

you set the selected index.
What about onrecordselection etc. events attached.
When they are there it is almost certain they cause it.
Simply disable them to test and you will know…

This might be the most likely. I did forget to mention that it was only on one form that I’ve tested so far. It does have a lot of calculations and events.

I’ve found that Servoy 3.x is catching tons of things that were done wrong but didn’t effect anything nor gave any error in 2.x. If this is the case on this error then it isn’t giving me any indication whats wrong like the others.

Unfortunately it’s a unique type of form and has a lot of fields with a lot going on. Will have to go over one by one or rebuild.

In the mean time I’ll get that solution on my bug report if I can’t get it going quickly.

Thanks everyone for the feedback.

IT2Be:
No idea.

Hopefully you realize there are smarter way to do this btw.
Have a look on the forum (search for looping or other keywords).

I’m sure and now I forget it was over a year ago I wrote it. But I think there was a “method” to my madness at the time - No pun intended :wink: . Checking into it.

The java.util.ConcurrentModificationException will be fixed in Servoy 3.1 rc1 (expected tomorrow)

Thank you for the prompt fixing of this. The previous error doesn’t show anymore but now I’m getting this:

java.lang ArrayIndexOutOfBoundsException: 0

On this line:

controller.setSelectedIndex(i);

Nothing is showing in the servoy log.

Also there was a minor seperate error with the new 3.1 RC1 build 403. First time going into servoy I got the message that I didn’t have licenses available. When I went to properties it said everything ok. I exited and then went back into Servoy with no message.

BTW I’m doing the loops differently and not using controller.setSelectedIndex anymore which works fine, just had to do a bunch of changes to the way I did things. Thanks.

please submit a sample solution demonstrating this issue in our support system: http://crm.servoy.com/servoy-webclient/ … oy_support

Done

We found and fixed the problem (will be in Servoy 3.1 final)