If you are going to do any kind of I/O to the db in your app, I'd keep it
open to minimize impact of continual open/close of db.

On the other hand, if memory is a real concern, and/or you only read some
stuff in when launched and don't do anything with the db again until you
quit, I'd be more in favor of closing it until you need it again.

Just my $0.02...



on 9/20/01 13:52, Chris DiPierro at [EMAIL PROTECTED] wrote:

> Hrm, why? I can see this being a sensible precaution perhaps if you're using
> some sort of shared database, but I'm curious as to why you'd recommend it
> otherwise.
> 
> While there's not a ton of overhead involved in opening/closing the DB, I
> don't see any real compelling reason to do so either. Snappy response time
> would in this case outweigh the remote possibility that some other app needs
> your DB while you're running.
> 
> The only real risk I could see if it your app crashes and the DB is left
> open somehow, but that in theory should be taken care of by reset, but even
> if it's not, you can take care of it yourself on the next instantiation of
> your application.
> 
> 
> "seelamneni satya" <[EMAIL PROTECTED]> wrote in message
> news:62988@palm-dev-forum...
>> 
>> open the database as you need and close the database as soon as possible
>> when u finished working with it
>> 
>> 
>> 
>>> From: Johnathan Smith <[EMAIL PROTECTED]>
>>> Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>>> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>>> Subject: Database should I keep it open?
>>> Date: Thu, 20 Sep 2001 13:19:20 -0700 (PDT)
>>> 
>>> My program uses the database and I would like to hear
>>> from palm programmers on if it is better to open the
>>> database once the program starts and close it once the
>>> program is closing or should I just open the database
>>> as I need it and close it right after I am done with
>>> it>
>>> 
>>> 
>>> __________________________________________________
>>> Terrorist Attacks on U.S. - How can you help?
>>> Donate cash, emergency relief information
>>> http://dailynews.yahoo.com/fc/US/Emergency_Information/
>>> 
>>> --
>>> For information on using the Palm Developer Forums, or to unsubscribe,
>>> please see http://www.palmos.com/dev/tech/support/forums/
>> 
>> 
>> _________________________________________________________________
>> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>> 
>> 
>> 
> 
> 


-Tom Hoelscher

~~~~~~~~~~~~~~~~~~~~~~~~~~
"Original Sin is hard to find, but the digitally enhanced version is readily
available".


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to