Hi again! DanH, I use thread synchronization. It works well. But, as I told in my first post, there are some problems:
The biggest problem: I can't use Cursor for my ListAdapter and ExpandableListAdapter I've got to use something like ArrayAdapter, read all data from cursor to java objects at one time. But, as I understand, CursorAdapter works better cause it can hold cursor open and scroll through cursor and read data when needed It works faster for me. So, also, here is new exception I've got today. I retried to implement UI handling with Cursor. And I've got SQLiteException: database is locked: BEGIN EXCLUSIVE; Who knows how to handle it? On 2 апр, 01:51, DanH <[email protected]> wrote: > A content provider won't provide any function over what you have now > -- it's just a different way to accomplish the same synchronization. > WithSQLiteyou basically can't have two transactions going on at the > same time, so you must either use semaphores or some such to prevent > "collisions" or use a server (content provider) so that all the > accesses are through a single thread. > > If you understand threads and thread synchronization/exclusion then > your way is probably more efficient and just as reliable. If you > don't understand threads then the content provider technique is safer. > > On Apr 1, 7:51 am, Evgeny Nacu <[email protected]> wrote: > > > > > > > > > Thanks to everyone! > > I've heard that ContentProviders do not have such problem. May be > > I'll try to use them, but I have many things to change. > > Thanks for the suggestion. > > > Evgeny > > > On 1 апр, 05:11, gjs <[email protected]> wrote: > > > > Hi, > > > > I (strongly?) suggest you wrap access to the sqlite3 database in a > > > Content Provider if you are accessing concurrently (doing both > > > read&write) from Activity & Service - particularly if Service is in > > > different process. > > > > Content Provider seems to manage concurrent access for you ok, without > > > having to get involved with semaphores/synchronization yourself. > > > > Regards > > > > On Apr 1, 9:21 am, lbendlin <[email protected]> wrote: > > > > > yes, semaphores are the way to go, especially for bulk write > > > > operations. it > > > > helps if you read some of the data from the database into a buffer. > > > > Then you > > > > can use the buffered data while the database update is processed, and > > > > the > > > > users may not even notice. -- 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

