Jason, that does help - thanks for the response.  Sounds like it's not
really that expensive to open and close a connection frequently untill there
is increased scale in either DB metadata or connection frequency.  I think I
am going to stick to one shared connection for now and see where that leads
me in the next couple of weeks...

-Cameron

On Mon, Apr 21, 2008 at 1:37 PM, jason_williams_mm <[EMAIL PROTECTED]>
wrote:

> The overhead in opening a connection only occurs when the database is
> not empty. We force some initialization to occur during an open
> operation to report errors right away rather than waiting until the
> first statement is executed. The initialization time is proportional
> to the number of tables and indexes within the database, as meta-data
> is read and loaded into memory for each.
>
> Generally you should only have need for a single connection.  As long
> as you are using the same connection for each operation the connection
> will take care of serializing access to the underlying database
> whether you  are using the aysnc or sync API.  Using a single
> connection will avoid the issues of locking within the same AIR
> application.
>
> The use-case for multiple simultaneously open connections to the same
> database, would be if you wanted to have more than one async read
> occurring simultaneously.
>
> Hope that helps some,
> jw
>
> --- In [email protected], Cameron Childress <[EMAIL PROTECTED]> 
> wrote:
> >
> > Looking for a pointer to some advice about a few SQLite issues.
> >
> > Is it generally best practice to keep a connection open and keep
> reusing
> > it (perhaps stashing it in the ModelLocator) or is it better to
> recreate
> > a connection each time you need to do a SQL operation?
> >
> > Also, I have read some about why to use sync vs async connections to
> > SQLite, but not much about using both sync and async in different parts
> > of an AIR application.  I've found that keeping a sync connection open
> > and stashed in a ModelLocator locks the db so that I can't make async
> > connections.  Since SQLite is a file based DB, this is not
> surprising at
> > all, but it does definitely call into question my initial effort at
> > keeping a connection open and just reusing it all over the place.
> >
> > Anyone have any advice or any good blog postings about this subject?
> > Specifically about when best to make and destroy connections.
> >
> > Thanks!
> >
> > -Cameron
> >
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
Cameron Childress
Sumo Consulting Inc
http://www.sumoc.com
---
cell: 678.637.5072
aim: cameroncf
email: [EMAIL PROTECTED]

Reply via email to