Maximum call stack size exceeded

0
Hi all, When manually executing a microflow which is actually used as a scheduled event I receive an error message saying: 'maximum call stack size exceeded’   Does anyone tell me what it is?  The microflow retrieves (about 50.000) objects from an API and commits these to the database. The API-call and commit happen while looping over about 50 objects. So the microflow does about 50 commits (of 1000 objects) in 5 minutes. Does it have something to do with that perhaps?   Kind regards,   Steve Jonk
asked
3 answers
0

Even if doing it in a loop and only commit batches, it will still be a single database transaction. When working with that many objects, it can cause issues. Is it possible to retrieve the objects in smaller batches from the api and do the actual processing in the mendix process queue? That would guarantee that each batch is committed in a single transaction. (There are also java actions, i think in the community commons, to start and end transactions)

answered
0

Thank you both very much! I will try Start- and Endtransaction.

I could not vind commitInSeperateDatabaseTransaction. Or is this not a community commons script?

answered
0

Maximum call stack exceeded usually means that this microflow is recursive (i.e. it has a Call Microflow action which calls itself). Then, if it does not terminate properly, you get this error. Either this microflow should not be recursive, or you need to ensure that it doesn't call itself too many times.

answered