As I understand it, SQLite on Android is not compiled to enable
locking.  Not that it matters that much -- when "locking" is done all
that really happens is that the second thread/process gets a SQL error
if the first thread/process has the DB busy -- there's no "wait"
performed.  The lock feature prevents corruption of the DB, but does
not allow it to smoothly handle multiple simultaneous accesses.

So even if SQLite locking is enabled, you still need a semaphore or
some such to keep multiple threads/processes from conflicting over the
DB.

On Feb 24, 11:43 am, Greg Donald <[email protected]> wrote:
> Is it possible for an activity and a service to both have simultaneous
> access to the same sqlite db?  So far I can't seem to find a way due
> to the "failed to close()" exception I get when I make the second
> connection.  I've tried a couple different setups so far, and it seems
> my only option may be to have my db stuff live inside the service so I
> never need the second connection.  Is my thinking correct or am I
> missing something?
>
> Thanks,
>
> --
> Greg Donald
> destiney.com | gregdonald.com

-- 
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