I have a simple query pulling information from a live database where the values can change. The problem is that the data I get can lag or fail to update at all despite the database being up to date.
For example, see this query where I pull a value:
I have a dataviewer Valentina Studio which is also connected and every time I pull a value with that it's up to date. But when my trigger fires and pulls the data then sometimes it's really old.
I'm reusing the same database connection rather than opening/closing a new one for each fire of the trigger. But I've also tried opening/closing the connection each query but the data is still old.
Any idea why this is happening? I can't use SQLite if the data I'm getting isn't reliable.
For example, see this query where I pull a value:
db_object = db_object or assert(sqlite3.open("some_db.db"))
local q = "SELECT thing FROM table WHERE field = something"
for row in db_object:nrows(q) do
print(row.thing)
end -- forI have a dataviewer Valentina Studio which is also connected and every time I pull a value with that it's up to date. But when my trigger fires and pulls the data then sometimes it's really old.
I'm reusing the same database connection rather than opening/closing a new one for each fire of the trigger. But I've also tried opening/closing the connection each query but the data is still old.
Any idea why this is happening? I can't use SQLite if the data I'm getting isn't reliable.