Configuring SQLite to wait indefinitely
Is there any way to configure
busy_timeout so that SQLite waits indefinitely?
I know I can set the timeout to
INT32_MAX milliseconds, which is roughly equal to 24.5 days of waiting. But I'm wondering if there is a more semantically direct way of saying "wait forever".
Curious, why do you need that? It is possible to get an example of an actual use-case?
Define your own busy handler which does whatever you want:
You can, of course, copy the default one and modify it for your own purposes.
However, along with Ivan, I suspect something weird is going on if a pause of 24 days is not enough for your purposes. It might be to your advantage to tell us what you're really trying to do.
(4.1) By Scott Robison (casaderobison) on 2021-10-26 21:32:24 edited from 4.0 in reply to 3 [link] [source]
Based on the phrasing, it seems what is wanted is a "wait forever" that semantically says what is being sought vs "wait for a really long but finite time". Something that in code would be immediately obvious as the difference between "wait until something is available" and "wait until something is available or the timer elapses".
To that end, defining a custom busy handler would be the way to do that as described.
Your understanding is correct. 24 days is obviously more than enough wait time. I was just looking for something that expressed "wait forever" more directly to the human reading the code.
Since I am using SQLite via the Python standard library, I don't think I can define a custom busy handler. I'll make do with the 24 days.
Thank you all for the responses.