Hi everybody again!

So, advices here helped! Thanks!
After some research and testing this solutions seem to work OK:

I have only one!! writable sqlite db. (implemented using singleton as
some people suggested here)
Also, I've got some db code to synchronize write operations.
Only one thread can execute write transaction at one time. But I don't
care about opening Cursors and reading from them.
This solution works perfectly after some testing.

On 8 апр, 02:15, Dianne Hackborn <hack...@android.com> wrote:
> On Thu, Apr 7, 2011 at 2:04 PM, Nathan <critter...@crittermap.com> wrote:
> > "The database"? I guess that would work if you only use ONE,
> > statically determined database.
> > Since I don't have just one, I think I need a singleton hash table of
> > opened databases, like I mentioned.
>
> You are making this too complicated.
>
> class StuffDatabase {
>   SQLiteDatabase mDatabase;
>   static StuffDatabase getInstance();
>
> }
>
> class OtherStuffDatabase {
>   SQLiteDatabase mDatabase;
>   static OtherStuffDatabase getInstance();
>
> }
> > I'll take your word for it. So if the user opens 10 or 100 databases
> > in a session, I'll just leave them all open. That simplifies the
> > singleton implementation if I don't have to do reference counting.
>
> Why in the world do you have 10s of databases?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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