Hello! I try to change the password for the app user (in Data -> Users, field password) but for one specific user I can’t do it and get a lot of errors like:
Backendless encountered an error while handling the request. An internal trouble ticket with ID 21FC2546-5690-C7E0-FFFA-9ED03AC26000 has been created and we will be investigating the issue.
java.lang.RuntimeException: java.lang.StackOverflowError
java.lang.RuntimeException: java.lang.RuntimeException: …
I do it directly on the backendless website (management console). I got this error for one specific user. For another users I have tested - it worked well. What could it be and how can it be fixed?
It looks like you have a circular dependency in the relations. Users points to Profiles, which in turn points to `Users. For that specific user the Profiles object points back to him and that causes the circular dependency which causes the error in password update. I am not saying it should not work, but I am pointing out a deficiency in the data model.
Thank you!
How would you recommend to get Users data from Profile table in such case in Backendless? I mean to request profile table and get parent user data in the same request. Just remove relation from Users and get all profiles by making additional query to profiles (if I try the opposite case - get all profiles for a user). Or is there any possibility to JOIN all children in the same request as in SQL?
In order to get the user object associated with a specific profile, you’d run a query against the Users table with the following where clause:
profiles.objectId = 'profile-objectId'
For example, for the user in question in this thread, their profile’s objectId is E31ECACA-AA3B-66CA-FF96-8C4A24114800, so when you use the following where clause:
How can I get all profiles against the User? In case if I do not know particular profile.objectId-s but need to list all children? (Users -> Profiles as one to many)
You already have a relation from user to profiles. To get all profiles for a user you use that relation.
My point was that the relation column from profiles to user is rudimentary and not necessary, it leads to problems because it causes a circular dependency.