Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data stays in local datastore after unpinning

I can't get the unpinning to work and can't find a solution. I pin the data this way:

myGroup = queryGroup.getFirst();
if (myGroup != null) {
    ParseObject.unpinAllInBackground("Groups", new DeleteCallback() {
        @Override
        public void done(ParseException arg0) {
            myGroup.pinInBackground("Groups", new SaveCallback() {
                @Override
                public void done(ParseException arg0) {
                    if (arg0 != null) {
                        Toast.makeText(getApplicationContext(), "ERROR", Toast.LENGTH_SHORT).show();
                        arg0.printStackTrace();
                    }
                }
            });
        }
    });
}

and try to unpin it like this:

ParseObject.unpinAllInBackground("Groups", new DeleteCallback() {
    @Override
    public void done(ParseException arg0) {
        if (arg0 == null) {
            dataDeleted();
        } else {
            arg0.printStackTrace();
        }
    }
});

But it doesn't throw an exception and the data is still saved locally when I start a query.

like image 903
Bruno Avatar asked Jul 02 '14 21:07

Bruno


People also ask

What happens when datastore is full?

Whenever datastore is approx full then vm's are suspended but how it can create vmss file at that time if no more free space is left. If the datastore runs out of space, the VM's which request additional disk space are "paused" rather than "suspended", so you shouldn't see a . vmss file for them.


1 Answers

try deleting your local data and try again. I had some weird issues related to pinning, turned out I had objects pinned with no data in them, which messed up the pinning.

Using the following code, pinallinbackground works, are you able to try that instead of iterating through each object?:

query.findInBackground(new FindCallback<ParseObject>() {

      @Override
      public void done(final List<ParseObject> moves, final com.parse.ParseException e) {
        if (e == null) {
          if (debug) {
            Log.i("bjjMoves returned:", String.valueOf(moves.size()));
          }
          ParseObject.unpinAllInBackground("bjjMoves", new DeleteCallback() {
            public void done(ParseException e) {
              // Cache the new results.
              ParseObject.pinAllInBackground("BJJMove", moves);
            }
          });

you'll notice I'm using PinAllInBackground, not pininbackground.

like image 98
Evan R. Avatar answered Sep 21 '22 13:09

Evan R.