Hi gcstang,

Very basic but check the following:-
1- Is any other app using your DB?
2- Did you close the cursor every time when you opened it?


Thanks,
AJ

On Oct 25, 5:41 pm, gcstang <[email protected]> wrote:
> ping, anyone that can answer this?
>
> On Oct 16, 10:58 am, gcstang <[email protected]> wrote:
>
> > Here is the stack:
>
> > android.database.sqlite.SQLiteException:errorcode5:databaseislocked
> >         at
> > android.database.sqlite.SQLiteStatement.native_execute(Native Method)
> >         at
> > android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:
> > 55)
> >         at
> > android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:
> > 1779)
> >         at
> > android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:
> > 1709)
> >         at com.myapp.MyDbAdapter.updateField2(MyDbAdapter.java:468)
> >         at com.myapp.MyView$13.run(MyView.java:1260)
> >         at java.lang.Thread.run(Thread.java:1102)
>
> > On Oct 15, 11:54 am, DanH <[email protected]> wrote:
>
> > > Where is theerrorbeing thrown from?  (You might include the
> > > exception traceback.)
>
> > > On Oct 15, 9:44 am, gcstang <[email protected]> wrote:
>
> > > > Has anyone encountered this and is there a solution to work around it?
>
> > > > I'm creating a Thread and in that thread I open adatabaseconnection
> > > > using the DBHelper, perform an update on a field in mydatabaseand
> > > > close it. I create a separate one in the Thread because if the View is
> > > > closed the global one for that view is closed, causing my Thread
> > > > update to throw anerror.
>
> > > > The thread is in a View, that also has it's own instance of the
> > > > DBHelper and
> > > > opens thedatabaseonCreate
> > > > closes it onPause
> > > > opens it onResume
> > > > closes it onDestroy
>
> > > > The instance in my Thread is throwing this but not all the time :error
> > > >code5:databaseislocked
>
> > > > Is there a known practice I should implement so I don't get thiserror?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to