Re: [sqlite] finalize or reset? (was Problem with SELECT by rowid after INSERT)

2019-04-12 Thread Richard Hipp
On 4/12/19, Keith Medcalf  wrote:
>
> On Friday, 12 April, 2019 12:36, Richard Hipp  wrote:
>
>>Perhaps the SELECT is running inside of a transaction that was
>>started
>>before you did the INSERT.  For example, perhaps you didn't
>>sqlite3_finalize() the previous SELECT, which caused it to hold the
>>read transaction open.
>
> Is it not sqlite3_reset that clears the transaction held by the VDBE code as
> part of resetting the context back to the unexecuted state and that you do
> not have to actually finalize (release) the statement

That is correct.  I wrote hastily.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] finalize or reset? (was Problem with SELECT by rowid after INSERT)

2019-04-12 Thread Keith Medcalf

On Friday, 12 April, 2019 12:36, Richard Hipp  wrote:

>Perhaps the SELECT is running inside of a transaction that was
>started
>before you did the INSERT.  For example, perhaps you didn't
>sqlite3_finalize() the previous SELECT, which caused it to hold the
>read transaction open.

Is it not sqlite3_reset that clears the transaction held by the VDBE code as 
part of resetting the context back to the unexecuted state and that you do not 
have to actually finalize (release) the statement (that is, the VDBE program 
must be "in progress" in order to hold a transaction).  Granted, finalize does 
a reset before de-allocating the VDBE resources, but is not resetting the 
statement (or allowing it to run to completion (SQLITE_DONE)) sufficient?

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users