Am 17.08.2015 um 12:32 schrieb Richard Hipp:
> On 8/17/15, Ulrich Telle <ulrich.telle at gmx.de> wrote:
>> I use version 3.8.11.1 of SQLite in my application. The application
>> opens a database connection on start up. This connection is kept open
>> until the application is terminated.
>>
>> After opening the database a temporary table is created. Accessing this
>> temporary table works as expected directly after it has been created.
>> However, a few seconds (5-10) later I get an error from SQLite on trying
>> to access the temporary table again, stating that the temporary table
>> doesn't exist. My database connection was *not* closed in between, and
>> the temporary table was *not* dropped explicitly.
>>
>> As far as I understood the SQLite documentation, a temporary table is
>> automatically destroyed only on closing the database connection. So I
>> wonder what could cause the temporary table to disappear unexpectedly?
>>
>
> The TEMP tables are reset by both:
>
>       PRAGMA temp_store=<value>;
>       PRAGMA temp_store_directory=<value>;

Thanks a lot. That's the explanation. Indeed, I used "pragma temp_store" 
*after* creating the temporary table. The documentation of the pragma 
clearly states this behaviour. However, I added the use of this pragma 
quite long ago (and forgot about it), and only recently added an 
additional temporary table without paying attention to the fact that the 
application issues "pragma" commands elsewhere later on.

Maybe a small note could be added to this documentation page, that not 
only closing the database connection but also "pragma temp_store" 
deletes all existing temporary tables:

https://www.sqlite.org/tempfiles.html

Regards,

Ulrich


Reply via email to