Jump to content

SQLite - Database is locked


Recommended Posts

Hi Lava Citizens, 

I am trying to implement SQLite - update function so i can easily modify values in a selected row. 

http://www.sqlitetutorial.net/sqlite-update/

I have tried this statement - UPDATE ESD_User SET Name = 'James Bond', Status = 'Employee', Location = 'Canada' WHERE EmployeeID = 5;  using the DB Browser for SQLite. The command does update the values as expected. 

I am trying to do same with the labview + sqlite driver. I have attached the update user code. 

I am getting an error from EXEC SQL

"SQLite.lvlib:Connection.lvclass:Execute SQL (Single String).vi:760001:Step on "UPDATE ESD_User SET Name = 'James Bond', Status = 'Employee', Location = 'Canada' WHERE EmployeeID = 5;"

SQLITE_BUSY: database is locked."


Can you please explain the cause of this error? 

Thank you, 

max

UpdateRecords.png

Edited by maxout
Link to comment

The lock will be being caused by something else than the code being blocked, so you should post the rest of your code.  Are you properly closing the “SQLite Connection” when finished with it?  Leaving a transaction uncommitted?   A Prepared Statement unreleased?

BTW, you don’t need the BEGIN/COMMIT VIs in that code, as it’s only one SQL statement.  

Link to comment
  • 3 weeks later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.