> So in addition to only being able to have the single db instance, you
> also find you have to take precautions (using transactions) to only
> give it one query at a time?  Am I understanding correctly?

Not necessarily... That is just how I had it set up from the beginning, more
because I didn't want to have the db open the entire time my app was
running.

I don't think there would be any problems keeping it open the whole time
(but I don't know because this is the only way I've ever done it)...

On Thu, Feb 24, 2011 at 12:09 PM, Greg Donald <[email protected]> wrote:

> On Thu, Feb 24, 2011 at 12:17 PM, Justin Anderson <[email protected]>
> wrote:
> > The way I do it is by creating an Application subclass with helper
> methods
> > to access the db.  That way access only happens at one spot and both
> > activities and services should be able to access it just fine.
> >
> > Another thing I do (which works in my case because db access doesn't
> happen
> > all that often) is open the database before every transaction and close
> it
> > at the end.
>
> So in addition to only being able to have the single db instance, you
> also find you have to take precautions (using transactions) to only
> give it one query at a time?  Am I understanding correctly?
>
> Thanks for the insight on this.  I've only built games so far, and am
> just now getting into my first "business" app with services and dbs
> and what-not.
>
>
> --
> 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
>

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