Sign in to follow this  
Followers 0
Stickman

SQLite INSERT succeeding...but not

3 posts in this topic

#1 ·  Posted (edited)

I'm using the SQLite UDF in a small app I'm writing. It's all gone very well so far, but I've stumbled across a problem and nothing I do seems to help.

Here's a simplified summary of what I'm doing:

1) First, I'm reading a sequence of rows from a table

2) Then, I'm writing a new row to the table

3) Finally I'm running the same read query as in 1)

...and it appears to have worked -- the new row is there.

However if I quit the app and restart, the row is gone.

And...if I just quit the app and look in the folder where the db file is stored, I have a new file called my_db_file.db3-journal. From what little I know of SQLite I'm guessing there's some locking problem but I can't seem to find any way to fix it (if this indeed even the case).

Can anyone tell me what's going on? I'm banging my head on the desk here.

Edited by Stickman

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I just tried adding a call to SQLite_Close() just before the insert and it returned 5 ($SQLITE_BUSY) so that's obviously the problem.

The code is rather spread out, so I'll try to create a reduced test case and post it later today. Thanks!

In the meantime, is there something obvious that I might have forgotten to do after my SELECTs?

// EDIT: Fixed! I needed to add _SQLite_QueryFinalize() after my SELECTs. ;)

Edited by Stickman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0