Friday, December 23, 2011

Re: [android-developers] Re: Data written to SQLite database not immediately available

To OP:

Do your threads use separate instances of SQLiteDatabase object pointing
to the same database one- or one SQLiteDatabase instance, shared?

23.12.2011 18:03, Ralph Bergmann | the4thFloor.eu пишет:
> Am 23.12.11 00:06, schrieb lbendlin:
>> it's not a bug, that's how SQLite works. You can't have concurrent
>> writes. Not sure how the content provider buffers this but if you do
>> plain SQLite you are basically blocking the database with each write,
>> and you need to use semaphores to manage that.
> I think a content provider can handle that.
>
> I think you only have a timing problem. The content provider needs a
> little bit to store the data.
>
> You send a ping from one thread to the other thread. A better solution
> is to register a content observer. With this observer the other thread
> gets automatically a notification if the content provider has saved the
> data.
>
>
> Ralph
>
>

--
Kostya Vasilyev

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate