Repository navigation
Replies: 9 comments
|
Is SQLiteStudio the only application connecting to this database? I've just verified this and I don't observe this issue. Can you please follow these steps when you encounter this problem? |
|
I have something the other way around with it. Don't know how relevant this is. I have the database file open in SQLiteStudio while also doing some queries (insert, update, delete) on the same database over a website. This database file is accessed from the network. The data itself is visible on the website but not in the application. If I click on refresh table view, the data that was previously inserted isn't showing up. closing the connection to the db and opening it again doesn't fix it. closing and restarting the application doesn't fix it (even after multiple times). I have to actively overwrite the database file (for example overwrite the database with another copy. |
|
SQLite databases are not reliable and not recommended when are accessed over the network filesystem/network shared folders: https://www.sqlite.org/useovernet.html |
|
I'm aware of that. What makes me wonder is if SQLiteStudio cached the database file somehow? The website is aware of the changes and uploading the db file over ftp and downloading the same db file again makes all the changes done by the website visible in SQLiteStudio (after closing the connection, downloading and connecting to it again). I assume SQLiteStudio always opens a read-write connection and keeps it continously open? Is the database corrupted if a process on the host machine does some changes but the connected sqlitestudio cannot see them (even after closing the connection and restarting the application)? The apache sqlite3 modul doesn't seem to be affected and continues to work normally. Almost as if sqlitestudio looks at an image of the database from the past 😄 I'll have to some testing with "pragma integrity_check;" after I have this difference in data content being displayed. As for the OP:
OP has a windows server running which for me suggests the 2nd option. |
|
What is a nature of the "network access" in this case? Are you pushing/pulling file over FTP from the "website server" to local machine where SQLiteStudio is running? |
|
my usecase is basically the following:
As a note: the scenario described below not my normal usage. just the behaviour I experience when this happens: On the pc I open the database files on the NAS to edit them. While the db is open, I run an insert/update query on the NAS webserver over a browser. I see the data being successfully applied (there is a counter that increments). Now back in sqlitestudio I can refresh, close the connection, restart the app but the data doesn't become visible in sqlitestudio. However, if I upload the db file over FTP and download it again (so basically the same file but updated creation time) sqlitestudio sees the data correctly. If the connection to the db file is closed. I run queries against the sqlite db and after that open the db in sqlitestudio, I can see the changes. Afaik in php sqlite connections are terminated after the script run. So changes are commited to the db file. Is this some of these uncertain things that can happen? Is there a way to force sqlitestuidio to disregard some kind of caching? |
|
There are various caveats regarding operations on SQLite database file over the network and samba share is very much such a case. I've pointed out a detailed description of these caveats from SQLite official page already. SQLite relies heavily on native filesystem locking. It also produces aside files (for ongoing transaction and Write-Ahead Log). If such aside file is not synchronized properly over the network, you may very much observe the database as if it was from the past. I'm not expert in SQLite internals, but I do know that Samba shares are historically known to cause problems exactly like yours. |
|
Can we turn this into a discussion topic maybe? OP hasn't come back after over a month of silence on a barebones issue report. Yeah, I read the article. I gave you the exact setup because you asked :) On actual file operations the database locking seems to work correctly. have the db file open in sqlitestudio over network while trying to overwrite the db file with filezilla from the same remote pc. It will fail because the database has an active handle. The only thing that makes me wonder is why sqlitestudio keeps remembering the state - even after disconnecting and stopping the application. |
There could be at least few explanations for this. The one that is most persuading me is that Windows copy of the database is being locked by SQLiteStudio as it maintains the open connection and Samba is unable to update it with data pulled from remote server. If this would happen on the same machine (i.e. SQLiteStudio and Web application are on the same machine), the file locks are entirely maintained by SQLite and it handles such situations, but when Samba is involved, then file locking is not under SQLite control and Samba is unable to deal with it. That's why SQLiteStudio operates on the old (not updated) copy of the file. EDIT: |
Uh oh!
There was an error while loading. Please reload this page.
Details
See title.
Steps to reproduce
Open a SQLite3 database, do some stuff, close the connection, try to delete/replace the database file.
Operating system
Windows Server 2012.
SQLiteStudio version
3.4.13
All reactions