SQLite Forum


8 forum posts by user Maxulite occurring on or before 2020-06-02 13:36:51.

More ↑
13:36 Reply: Unexepected commit result with two threads application (artifact: 9d833bf6c0 user: Maxulite)

Well, it looks like I need to require some additional knowledge about locking, transaction kinds and deadlocks when db is busy. But after some reading I have a question regarding SQLITE_BUSY. Is it safe to assume that any Sqlite function that returned SQLITE_BUSY should not be called second time?

11:14 Reply: Unexepected commit result with two threads application (artifact: 9eca70676c user: Maxulite)


It looks like I have no busy handler, only greedy waiter (no sleeping), and I just looked several times, the main thread tried to do commit for update operations and got SQLITE_BUSY two times (sqlite3_step calls), after that SQLITE_DONE with the consequences I described. I checked this several times, no exception, every time the counter of SQLITE_BUSY results is always 2 before SQLITE_DONE. And very fast (subjectively)

I know that it's better to do a graceful waiting with my own sleep or little help from Sqlite, but I suppose the greedy waiter can't be the reason behind this issue.

09:59 Post: Unexepected commit result with two threads application (artifact: ba6f754fc2 user: Maxulite)

I met an unexpected Sqlite behavior in my note-taking application on Windows. But I may have wrong assumptions about how locking is working so maybe a fix in the code is needed.

The application basically uses the same db in two threads. But each one opens a separate db connection (the same db physical path). 
- Thread 1 is about all general information retrieval and change (UI thread).
- Thread 2 is for quick search in the search box in order to show a popup list of the phrases met a search criteria while the user is typing. 

The problem is when the application want to commit in the main thread (after several Update statements), but quick type search is still searching, the overall consequence looks like a rollback effect: commit returns SQLITE_OK, no new changes in the data, the rollback file is gone and the date of the main db file is the one that was before this change was tried.  

I checked this with 3.32.01 version, Windows 7, 32 bit app 

Do I expect too much about auto-locking handling and probably still need some inter-thread locking mechanism despite the fact that the connections are different? 

10:58 Post: matrix subpath at sqlite.org (artifact: 1139196f52 user: Maxulite)
I noticed some kind of mirror content at sqlite.org. 

For example
is identical to

The confusion starts when search engines currently index both often offering the results as different entries. Try googling [sqlite download] for example. 

Is this some kind of ongoing migration? If so, maybe it's better to forbid one of them with robots.txt? 


12:23 Reply: PSA: All books in the ACM digital library are free to download for the next 3 months (artifact: f1cdee089e user: Maxulite)
Thanks for sharing, and thanks ACM for this great gesture. Plenty of great books and publications. 

Of course, I queried Sqlite, also interesting research books and papers. Found a past year interview with drh
  [Richard Hipp Speaks Out on SQLite]
It was probably behind the paywall since the publication date, at least some very interesting direct quotes from it are not discoverable by Google.
09:33 Reply: progress handler from user functions (artifact: a762001840 user: Maxulite)
I thought maybe for some reasons, the context of calling the progress handler and user function might be different for sqlite. But according to the docs, the progress handler is already quite restricted in what it can do (no database connection modification). Also common sense hints that both are quite "external" for Sqlite. 

Probably the main concern for me in this case is to get the progress handler I registered previously. In my case it's not global, but specific for particular database connection oop object. I'm sure there's no sqlite3_get_progress_handler or something like this in api, so probably I will have to implement some global registration to obtain the handler of a database connection from the global context of user functions.
17:35 Post: Seach engine crawling of new forum posts (artifact: 5fd0acff89 user: Maxulite)

I usually made a site-bound search of sqlite mailing list archives before posting about some specific topic. With the new forum I have to add a new step for searching on this new forum. I see that there is full-text search enabled on the site, but I sometimes prefer using Google. But currently, despite the fact that the forum already a couple of weeks old, the query 


as well as 


in Google don't show any post results. 

Is this intentional or just some unexpected disagreement between the site and the search engine? This couple of week delays is not a big deal for an average site, but sqlite.org is too important resource to crawl with low priority imho.


17:08 Post: progress handler from user functions (artifact: 03c94975a1 user: Maxulite)

My function might wait for some condition to be met (even as simple as delay), but I would like to software still be responsive during these period. Can the user function use the progress handler that was registered with sqlite3_progress_handler directly? And if it's not a good idea, is there some sqlite3_ call I might invoke in order to achieve this?