On Fri, Jul 9, 2010 at 3:44 PM, Federico Paolinelli <[email protected]> wrote: > I am now wondering what happens to a cursor while the data is being > changed.
Most of the time, a Cursor holds all the data represented by the result set, and so it is unaware of any changes you make to the database. > And more: I get a cursor as the result of the query. Does it contain > the real data or is the data fetched every moveToNext() call? If contains all of "the real data" after you first try using it. So, rawQuery() returns right away, but if you call moveToFirst() or something, at that point it does the query and holds the results. The exception is if you have a really big result set (>1MB), in which case it uses a "windowed" Cursor, and I have no idea what the rules are for it. > What > happens if data is pushed to the db while I am still using the cursor > on another thread? Nothing much, AFAIK. The Cursor will be oblivious to any changes until you requery() it. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 Available! -- 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

