Racket web-server question

81 views
Skip to first unread message

Rohan Posthumus

unread,
Jul 6, 2021, 3:53:41 AM7/6/21
to Racket Users
Good morning everyone,

Sorry, this is a bit of a noob question, but this is my first Racket program :-)
I build a CRUD in Racket web-server, everything seems to work well but my Sqlite database does not update the data until I restart the server. I tried a few things, but all in vain. 

Any suggestions?

Kind regards
Rohan

schle...@gmail.com

unread,
Jul 8, 2021, 11:33:07 AM7/8/21
to Racket Users
That is strange, I haven't had that problem.
I assume you are using a sqlite db that is stored in a file? (not an in memory one because that would be reset everytime?)
Are you sure you aren't doing your updates in some kind of transaction that remains unfinished for some reason for a long time?

Not really sure how to help you, without more information.
Things you could try:
different/newer sqlite versions, e.g. by using bogdan's https://pkgs.racket-lang.org/package/libsqlite3
try the `#:use-place #t` parameter in the `sqlite3-connect` function and see if that changes anything.
maybe try to create a minimal example and see if that still has that problem and share that code, so we can try to reproduce the problem

Whats your racket and sqlite version?
What OS / architecture are you on?
Have you tried a crud with only racket scripts and sqlite? (trying without the webserver to make the test simpler and know that that part can be ignored by bug analysis)

I am not sure whether there exists any verbose logging that could be enabled for db interactions.
This issue suggests there is a bit of logging, that could need better documentation: https://github.com/racket/db/issues/10

Simon

Rohan Posthumus

unread,
Jul 13, 2021, 2:30:16 PM7/13/21
to Racket Users

Good evening Simon,

Thank you so much for all your suggestions. I finally figured it out (after going down a few rabbit holes).
It wasn't the database/connection that was the problem. When I used other software to view the tables, I could see that the queries were correct.
My mistake was that I did not understand a few of Racket's concepts (xexpr, quoting, interop between #lang etc.). 
I ended up rewriting #lang scribble/html code to xexpr and everything just worked after that.

Thanks again for your (and David Storrs') inputs. My app is a couple of thousands of lines of Racket code and no errors:-)

Kind regards
Rohan
Reply all
Reply to author
Forward
0 new messages