'Server.Processing'

This Error is displaying more than sometimes BTW I’m on iOS - Objective-C

FAULT = ‘Server.Processing’ [java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction] <java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction>

Hi,

Please clarify - what a function responds this fault?
Could you add some sample code here?
To help you we have need to reproduce this problem.

Regards,
Slava

We are having the exact same problem! Code is posted below:

let dataStore = self.backendless.data.of(BackScore.ofClass())

            var error: Fault?

            

            let result = dataStore.findID(self.backScoreToSend.objectId, fault: &error) as? BackScore

            

            if error == nil {

                print("Contact has been Found: \(result)")

            }

            else {

                print("Server reported an error (2): \(error)")

            }

            

            result!.team!.bidLocation = self.backCurrentComp.hashtagName

            result!.team!.bidValue = "NO"

            

            

            _ = dataStore.save(result, fault: &error) as? BackScore

            if error == nil {

                print("Contact has been Saved: \(result?.objectId)")

            }

            else {

                print("Server reported an error (2): \(error)")

            }

            

            self.backFilteredScoreList = [BackScore]()

            

            let whereClause = "competition.hashtagName = '\(self.backCurrentComp.hashtagName!)'"

            

            print(whereClause)

            let dataQuery = BackendlessDataQuery()

            dataQuery.whereClause = whereClause

            print(whereClause)

            

            var grabError: Fault?

            let bc = Backendless.sharedInstance().data.of(BackScore.ofClass()).find(dataQuery, fault: &grabError)

            if error == nil {

                print("Contacts have been found: \(bc.data)")

            }

            else {

                print("Server reported an error: \(error)")

            }

            

            

            self.scoreList = bc.getCurrentPage() as! [BackScore]

            

            self.scoreList.sortInPlace { $0.numberedScore > $1.numberedScore }

            

            

            

            self.makeFilteredArray(self.dayString);                self.tableView.reloadData()

            self.performSegueWithIdentifier("unwindToScoreList", sender: self)

There are three calls in your sample: ‘findID’, ‘save’ and ‘find’. Which of them responds with a fault?
And could you add BackScore class implementation (here - or send to support@backendless.com)

I’m getting the same issue with this code:

 Backendless.sharedInstance().userService.update(Backendless.sharedInstance().userService.currentUser, response: { _ in }, error: { fault in  print2("Can't update currentUser: \(fault.detail)") 
 })

Error:
11:01:17.961: Can’t update currentUser: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

Hi Andrey!

Could you show how user object looks like?
Regards,
Kate.

This doesn’t happen only on the frist launch, when the user has logged in. All the next launches throw this error.

Acutally, just happened on the first launch, so nevermind this comment. The issue is persistent

http://support.backendless.com/public/attachments/81c43a53cccc53e563cf0840862fa70e.png&lt;/img&gt;

Thanks Andrey!
Can we also see your code, where you fill the user’s field and then save it?
And please provide your application ID (here or you may send it to support@backendless.com).

I have the following computed properties:



    private(set) var score: Int {
        get {
            return Backendless.sharedInstance().userService.currentUser.getProperty("score") as? Int ?? 0
        }
        set {
            Backendless.sharedInstance().userService.currentUser.setProperty("score", object: newValue)
        }
    }
    
    var patientType: PatientType? {
        get {
            return Backendless.sharedInstance().userService.currentUser.getProperty("patientType") as? PatientType
        }
        set {
            Backendless.sharedInstance().userService.currentUser.setProperty("patientType", object: newValue)
        }
    }
    
    private(set) var questionResults: [QuestionResult] {
        get {
            return Backendless.sharedInstance().userService.currentUser.getProperty("questionResults") as? [QuestionResult] ?? []
        }
        set {
            Backendless.sharedInstance().userService.currentUser.setProperty("questionResults", object: newValue)
            saveCurrentUser()
        }
    }

AppId is 926934A4-6CD8-D1DA-FFA2-1510B0D1BF00

I also get “The request timed out.” error very often when trying to save either a user or a QuestionResult object. This is not related to my Internet connection, as I have a good Wi-Fi connection

Thanks, Andrey, this is very helpful. One more question to help us reproduce the error: you mentioned it occurs when you update the user object. Could you please let us know what properties exist in that object? The closer we can get to your use-case, the greater the odds of reproducing and eventually fixing the problem.

I can’t even log in to the app, constantly getting The request timed out error.

Please clarify: which class has this properties?

Keep in mind that extending or inheritance of an BackendlessUser class is not the best practice. Also you should avoid any “computed properties” in data model classes, because they can break an object serialization.

Could you provide your QuestionResult class - here or to support@backendless.com?

These properties are not in the User class, but in my custom UserService class instead.

QuestionResult:

class QuestionResult: BaseModel {

var question: Question?
var selectedAnswer: Answer?

}

And BaseModel? We need to see whole hierarchy of you data model class

func ==(lhs: BaseModel, rhs: BaseModel) -> Bool {
return lhs.objectId == rhs.objectId
}

class BaseModel: NSObject {

var objectId: String = ""

required override init() {}

override var description: String {
    return "id: \(objectId)"
}

override func isEqual(object: AnyObject?) -> Bool {
    if let object = object as? BaseModel {
        return object.objectId == objectId
    }
    else {
        return super.isEqual(object)
    }
}

}

Any updates?

Andrey, give me please a scenario: what should I do with your project to reproduce the problem?

Open the project, log in as aa@aa.aa/aa, go to Settings, choose a Patient type, press Confirm. The error happens occasionly, but it’s reproducable right now.

http://support.backendless.com/public/attachments/95c2ee53a0c8f31aad464d8b6697b35b.png&lt;/img&gt;