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...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

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