Concurrency issues in android sqlitehelper
i'm developing an app that uses sqlite database in android, and recently
i'm having frequent crashes that i think are related with concurrent
database access, altough the db exception is does not mention it..
here is the error:
09-15 15:25:45.672 195-1476/system_process V/ActivityManager©s Record
#1 ActivityRecord{a52ecf58 u0 com.pauloslf.efatura/.MenuInicial}:
app=ProcessRecord{a5317d60 0:com.pauloslf.efatura/u0a10049}
09-15 15:25:45.672 195-1476/system_process I/ActivityManager©s
Removing activity ActivityRecord{a52ecf58 u0
com.pauloslf.efatura/.MenuInicial} from stack at 1: haveState=false
stateNotNeeded=false finishing=true state=PAUSING
java.lang.RuntimeException: here
at
com.android.server.am.ActivityStack.removeHistoryRecordsForAppLocked(ActivityStack.java:4249)
at
com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3015)
at
com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3085)
at
com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:897)
at android.os.BinderProxy.sendDeathNotice(Binder.java:470)
at dalvik.system.NativeStart.run(Native Method)
09-15 15:25:45.672 195-490/system_process W/InputDispatcher©s channel
'a5239e68 com.pauloslf.efatura/com.pauloslf.efatura.MenuInicial (server)'
~ Consumer closed input channel or an error occurred. events=0x9
09-15 15:25:45.672 195-490/system_process E/InputDispatcher©s channel
'a5239e68 com.pauloslf.efatura/com.pauloslf.efatura.MenuInicial (server)'
~ Channel is unrecoverably broken and will be disposed!
09-15 15:25:45.672 195-1476/system_process V/ActivityManager©s No
result destination from ActivityRecord{a52ecf58 u0
com.pauloslf.efatura/.MenuInicial}
09-15 15:25:45.676 119-119/? D/Zygote©s Process 3287 terminated by
signal (11)
09-15 15:25:45.684 195-1915/system_process W/InputDispatcher©s
Attempted to unregister already unregistered input channel 'a5239e68
com.pauloslf.efatura/com.pauloslf.efatura.MenuInicial (server)'
I'm accessing the db class using a singleton:
private static FacturasDB faturasdb = null;
public static FacturasDB getInstance(Context context) {
if (faturasdb == null) {
faturasdb = new FacturasDB(context);
}
return faturasdb;
}
The most easy way for me to reproduce the issue is when the asynctask
started on the main activity (does db access on the background) is running
and i navigate to another activity that also uses the db..
Any idea why this issue happens ?
Thanks a lot in advance!
No comments:
Post a Comment