After calling code below for several times(5-10 times), done() method for SaveCallback doesn't fire and whole application seems to stuck. It seems that this request ruins request queue and all further queries doesn't fire their callbacks either. No errors in callbacks and in logs. " BEFORE SAVING" - displayed in logs, while " SAVED" - didn't.
Do I need to change parse pricing contract, or to change my code somehow?
Log.d("MESSAGE OBJECT", " BEFORE SAVING");
messageParseObject.saveInBackground(new SaveCallback() {
@Override
public void done(final ParseException e) {
Log.d("MESSAGE OBJECT", " SAVED");
if (e != null){
completitionCallback.error(e);
return;
}
chatObject.put(ModelConstants.LAST_MESSAGE_KEY, messageParseObject);
chatObject.getRelation(ModelConstants.MESSAGES_KEY).add(messageParseObject);
chatObject.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
Log.d("CHAT OBJECT", " SAVED");
if (e == null)
completitionCallback.success();
else
completitionCallback.error(e);
}
});
}
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…