Hi, I’m getting this error while performing a Deep Save from a cloud service but I’m struggling to find any information about it. Presumably the operation is going above some set transaction operation limit but what is the limit and how can I work around it? Presumably I can break down the the amount being saved a once but then I lose the automatic rollback functionality of a transaction.
Welcome to the Backendless Community.
The number of transactions available per transaction depends on the plan (you can see this both in the billing section and on our website with plan descriptions Backendless Cloud Pricing | Low Cost No-Code App Development Platform) Monosnap
If you don’t have enough transactions per transaction, you can buy additional pack in the marketplace Monosnap
It’s a little obscure what triggers this error. I was deepSaving a three level deep structure and it took some testing to find that one of the nested levels contains an array that can contain 0 to N elements. I can’t limit the number of elements the user might add to the array, so buying a pack with 20 operations really won’t help. So is there any workaround that still allows the safety of a transaction?
I think elements in an array are saved with bulk create, so regardless of the array size, it would take one operation in a transaction.
Hi Mark, I’m probably doing something wrong or misunderstanding. All other things equal, given this structure:
"name": "blah blah",
If the Object->person->vehicles array has 1 to 4 elements, it works. Five or more throws:
Error: Action requires more operations in transaction than currently available
at new ResponseError (/media/kelly/DEVO/elite/app/cloud-code/elite/node_modules/backendless-request/lib/index.js:42:116)
at checkStatus (/media/kelly/DEVO/elite/app/cloud-code/elite/node_modules/backendless-request/lib/index.js:237:9)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
“detail” is a JSON column. The person relation is 1-to-1, the vehicles relation is 1-to-many, and sometimes some of its elements will already exist, as 3 of the 4 in the example do, when updating the “pay” values. My Cloud 9 plan says 10 operations, my intuition says the above example should take 3 or 4 if the bulkCreate only counts as 1. Hence my confusion.
I neglected to realize or mention that Object->person->vehicles->type is also a 1-to-1 relation, so this baby is actually 4 levels deep.
@Kelly_Oglesby did you ever figure this out? Sounds like Deep Save is limited to x-number of operations that lie under the hood, and a 1:N relation (where N child objects are created & related) will not work if there are ~10 children to be created in a single Deep Save transaction. Please share your insights
Alex, I’m so sorry, but my solution was to just avoid the problem entirely and not use the feature. My thinking was that, given that there IS a limit, if, because of your use case, you can’t guarantee a maximum number of transactions in the save, you will eventually encounter the limit, regardless of what the limit is. So I just scrapped what I was doing and did it differently.
ah ok, thanks for the insight.