Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANR in AndroidRushQueProvider.blockForNextQue #92

Open
fabsimilian opened this issue Dec 10, 2015 · 1 comment
Open

ANR in AndroidRushQueProvider.blockForNextQue #92

fabsimilian opened this issue Dec 10, 2015 · 1 comment

Comments

@fabsimilian
Copy link

We have some ANRs in our Project due to rush queue:

DALVIK THREADS (38):
"main" prio=5 tid=1 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x759306c8 self=0xb4f07800
  | sysTid=17679 nice=0 cgrp=apps sched=0/0 handle=0xb6fa1ec8
  | state=S schedstat=( 0 0 0 ) utm=310 stm=39 core=0 HZ=100
  | stack=0xbe1e7000-0xbe1e9000 stackSize=8MB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x10a7e948> (a java.lang.Object)
  at co.uk.rushorm.android.AndroidRushQueProvider.blockForNextQue(AndroidRushQueProvider.java:26)
  - locked <0x10a7e948> (a java.lang.Object)
  at co.uk.rushorm.core.RushCore.load(RushCore.java:256)
  at co.uk.rushorm.core.RushSearch.find(RushSearch.java:41)

Any ideas how to fix this?

@Stuart-campbell
Copy link
Owner

Looks like you might need to use the async methods for saves and loads.

Async save is done by calling

object.save(new RushCallback() {
    @Override
    public void complete() {
        /* Callback is on the thread objects where saved on, 
            not thread that called save */
    }
});

You can use a null callback if you don't care about the response.

There is also an async load method on RushSearch. Just need to watch as the callback is not in the main thread.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants