[EMAIL PROTECTED] wrote:
> 
> Hello Joe,
> 
> Tuesday, October 30, 2007, 2:08:55 PM, you wrote:
> 
> JW> --- Teg <[EMAIL PROTECTED]> wrote:
> >> You'll just end up exchanging an "are you initialized" flag for a
"have
> >> you called the initialization routine" flag. I don't see it
changing
> >> the size or complexity. Either way, SQLite either has to ensure
it's
> >> initialized OR that someone has called the initialize function. It
> >> end up being the same check.
> >>
> >> I'm not sure why this is ever required. Static initialization flag
> >> that tells Sqlite to initialize itself internally or tells SQlite
that
> >> the user has initialized it.
> 
> JW> The user does not need a flag to track sqlite initialization.
> JW> He just calls sqlite3_initialize unconditionally before using
> JW> sqlite the first time. Every application and dynamically loaded
> JW> library has an entry point.
> 
> JW> Although it would be a good idea to allow the sqlite3_initialize
> JW> function to be called multiple times, as new dynamically loaded
> JW> shared libraries would not know if another shared library is also
> JW> making use of sqlite.
> 
> I was speaking of internally, inside SQlite. I'm sure you expect to
> get an error if you call into SQLite without calling the initialize
> routine first.

I wouldn't expect such a thing to be guaranteed.  I'd expect that it
might work, or it might crash, or it might give an error, or it might
silently give incorrect results (though we'd like to avoid the last
case), and that hopefully in a debug version an error would be produced.

> Instead of returning an error, why not initialize right there instead?

If a check was present, initializing would make sense.  The question is
whether checking at all entry points is sensible.  It's not efficient,
and might not be accepted for some platforms or uses.

-- James


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to