Im running into the issue again, but this time trying to create a relation with a BackendlessUser Parent object Optional(âTable âOptional BackendlessUserâ does not exists. Please make sure to configure your schema first. All tables and columns must be present in the database before a transaction is executed.â).
Could you please show how you reference the parent object in the code? Any sample code which would give us the context of the error will be very helpful.
I am somewhat confused and need your help. From the earlier message I understood that you get an error when you run a transaction. The sample code you posted has a commented out line This crashes the app. Is this a separate issue or they are related? (âapp crashingâ and âerror from the transactionâ)
A few more questions:
Does the transaction error happen with the code you posted? (where there is a commented line)?
What Backendless plan is the app on? I didnât quite understand how you can run the transaction but also said âTried to create a test app to demonstrate it, but without the springboard plan it looks like transactions is disabled.â
The test app I have in the console is free plan, trial expired.
This app is still on cloud 99 trial.
The commented line is a separate issue, sorry I should have removed it from the reply.
It looks like the backend is looking for a Table Called BackendlessUser instead of Users during a set relation transaction. (It may be the same issue calling update thatâs commented out)
Sorry Olha, I think I opened a can of worms here. Looks like âupdateâ crashes when a custom object is attached to the BackendlessUser
Im getting another error on the original issue
Unable to perform âSET_RELATIONâ operation due to argument incompatibility. The operation references a result from another âCREATEâ operation. The specified result cannot be obtained from this operation (list of objectIds).
here is example code to cause a crash
@objcMembers
class Person : NSObject {
var name : String = âJimâ
var objectId : String?
}
let uow = UnitOfWork()
let per = Person()
Backendless.shared.userService.currentUser!.properties["person"] = per
let myUser = uow.create(objectToSave: per)
let _ = uow.update(objectToSave: Backendless.shared.userService.currentUser!)
uow.execute(responseHandler: { result in
print("Is transaction successful - \(result.isSuccess)")
if !result.isSuccess {
print("Transaction failed: \(result.error?.message ?? "")")
}
}, errorHandler: { fault in
print("Error: \(fault.message ?? "")")
})