[plt-scheme] problem using sqlite and web server in combination (empty db file)
Hi Thomas, hi Noel,
thanks a lot for your answers. Seems I was totally wrong to think the
problem had to do with the web server's behaviour itself - thanks for
sharing the analysis of the problem!
Using define-runtime-path it works fine now - I deleted the empty file
and after a modification to the code, it was not created again.
So thanks again for the quick help,
Sigrid
Am 12.06.2009 um 02:18 schrieb Thomas Chust:
> Hello Sigrid,
>
> I'm not sure whether you are experiencing the same problem as me here,
> but at least the fact that a new empty database file shows up in an
> unexpected directory suggests that you may be.
>
> I ran into similar difficulties using SQLite3 from PLT Scheme and
> after some experiments I came to the conclusion that the current
> working directory as seen from PLT Scheme code is not always identical
> with the current working directory of the process as seen by the
> native SQLite3 code. Therefore specifying a relative path to a
> database file can easily cause SQLite3 to create a new empty database
> in some unexpected place. If I'm not mistaken, the value of
> current-directory disagrees with what the C library's getcwd returns
> as soon as the value of current-directory is parameterized.
>
> I would suggest to circumvent the problem by simply specifying an
> absolute path to the SQLite3 database.
>
> An arguably better solution would be to adapt the code in the SQLite3
> binding you are using to automatically convert paths to an absolute
> form before they are passed to the native sqlite3_open call.
>
> cu,
> Thomas