Hi,
I am making call to Backendless Android APIs for login and object retrieval. On making any Backendless APIs I am getting the exception "javax.persistence.NonUniqueResult exception - result returns more than one elements.
The App was working fine till today afternoon, I started getting this error from last 2 hours and can’t figure out the root cause. I even tried with the older builds which were working fine till yesterday, but getting the same exception. Could you please help.
Thanks,
Sunil
Hi Sunil,
Can you please provide an example of such request with your application ID?
Hi Sergey,
The App Id is: 2C25604F-240D-0545-FF8A-0677DBD82100 and I am getting this error time when ever I call and Backendless android apis some of the examples are Backendless.UserService.login(), Backendless.Persistence.of() etc.
Thanks,
Sunil
Also, one other thing I wanted to mention here is that in our App we wanted to have separate databases for Dev and Prod environments. So I created another Database App project on Backendless (With App ID “B57B7A4C-83FB-7178-FF07-7C47E7258B00”) for Prod environment. The App initialises the Backendless with proper App Id/key pairs based on the debug(dev)/release(prod) mode by invoking Backendless.initApp() method while App is being started. This scenario was working fine.
In one special case for the release mode of the App, we wanted to give some users Sample login credentials and with those credentials App should point to the Dev database rather than Prod database project. In order to implement that we were checking the credentials on the Login screen and if it is the Sample credential then we re-initialise the Backendless by again invoking Backendless.initApp() with Dev appId/key pair, but this was not switching the app to point the Dev db project and we started observing this exception (javax.persistence.NonUniqueResult exception). Alll the subsequent call to Backendless Apis throw the same exception. We even tried with the older builds before this implementation, but getting the same exception.
Can you please respond to following queries.
- What will the best way to maintain separate databases for dev and prod environment on Backendless.
- Is it possible to reset or re-initialise the Backendless with new set of App id/key after it is already initialised with some other set of app id/key.
- What should be the best approach if we want to defer the Backendless initialisation until user provides some input (Ex: Login credentials).
I would highly appreciate your quick response on this.
Thanks,
Sunil