Mark, the point where database changes are made is in commit(). If you did a 
commit(), your changes are persisted, if not, they are not. This is a 
critical part of the behavior of a database.

Closing the database (or database connection) has no bearing on this. There 
is nothing it is *allowed* to do that is important to your application.

Thus, if one database connection is opened, but never closed, and the number 
of database connections does not grow over time with any reasonable usage 
pattern, we should *not* term this a leak.

On Tuesday, March 29, 2011 7:27:12 AM UTC-7, Mark Murphy (a Commons Guy) 
wrote:
>
> On Tue, Mar 29, 2011 at 10:19 AM, Kostya Vasilyev <kman...@gmail.com> 
> wrote:
> > There is no leaked database connection with Content Providers.
>
> Yes, there is, at least by my definition (close() not being called).
>
> > What happens is, the database is kept open as long as the application
> > process is alive, and is open just once, too.
> >
> > When/if the process is killed, the OS kernel closes the file.
>
> That presumes that there is no SQLite logic in a database close() that
> is important. One hopes that is the case, given the way content
> providers are implemented.
>
> -- 
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training...At Your Office: http://commonsware.com/training
>
>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to