Re: [sqlite] How long can I keep a prepared statement around?

2006-09-25 Thread Roger Binns
[EMAIL PROTECTED] wrote: > The TCL bindings also keep a cache of recently used SQL > statements. The bindings automatically detect if the SQL matches a statement in cache > and reuse the existing sqlite3_stmt if it does. Does the TCL wrapper allow multiple commands in one go? eg can it be

Re: [sqlite] How long can I keep a prepared statement around?

2006-09-25 Thread drh
"Shields, Daniel" <[EMAIL PROTECTED]> wrote: > > > > Use the function sqlite3_expired to determine, when you need > > to recompile a prepared statement. That's the approach I use. > > > > Mike > > How does this compare with the re-preparing statements that > have failed with a SQLITE_SCHEMA

AW: RE: RE: [sqlite] How long can I keep a prepared statement around?

2006-09-25 Thread michael . ruck
That's basically the way I do it. I have a factory method for all prepared statements, where I wrap the (optional) recompilation in and aquire a named mutex for every method invocation in the class. I think this should be a safe approach to prevent SQLITE_SCHEMA errors if the only schema

RE: RE: [sqlite] How long can I keep a prepared statement around?

2006-09-25 Thread Shields, Daniel
> Looking at the implementation of sqlite3_expired, its just a > comparison of the expired flag in the statement or if the > passed statement is NULL. The cost is an additional if > statement before execution, however this does not save you > from SQLITE_SCHEMA errors. In theory someone could

AW: RE: [sqlite] How long can I keep a prepared statement around?

2006-09-25 Thread michael . ruck
Looking at the implementation of sqlite3_expired, its just a comparison of the expired flag in the statement or if the passed statement is NULL. The cost is an additional if statement before execution, however this does not save you from SQLITE_SCHEMA errors. In theory someone could modify the

RE: [sqlite] How long can I keep a prepared statement around?

2006-09-25 Thread Shields, Daniel
> > Use the function sqlite3_expired to determine, when you need > to recompile a prepared statement. That's the approach I use. > > Mike How does this compare with the re-preparing statements that have failed with a SQLITE_SCHEMA error during sqlite3_step? e.g.

Re: [sqlite] How long can I keep a prepared statement around?

2006-09-24 Thread Kervin L. Pierre
Hello Michael, Thanks. Best regards, Kervin --- Michael Ruck <[EMAIL PROTECTED]> wrote: > Use the function sqlite3_expired to determine, when > you need to > recompile a prepared statement. That's the approach > I use. > > Mike > > Am 24.09.2006 um 20:48 schrieb Kervin L. Pierre: > > >