LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQLlite Locking in Labview??

Hello All,

 

I was hoping to understand how you determine what locking state is used for opening SQLite databases.  Accouding to link https://www.sqlite.org/lockingv3.html the default is "UNLOCKED"; but what is implemented in the Labview library and how is it controlled.

 

So using the "SQLite Example 1 -- Create Table.vi" from the examples"

 1. How would I know what locking state the DB is opened in?

 2. How would control /change the locking state?

 3. Which locking state is best if multiple applications are sharing the DB?  Unlocked?

 

I currently notice while running my application that another SQLite viewer has difficulity viweing the data in the DB.  How can I resolve this?  At least while one application is writing to the DB others should be able to view the DB; right?

 

Thank you for your help,

 

0 Kudos
Message 1 of 9
(4,454 Views)

Hi,

 

What LabVIEW library are you using?

 

Cheers

0 Kudos
Message 2 of 9
(4,382 Views)

I am using the Library from the NI wedsite by James Powell.  I installedit using the JKI Package Manager.

0 Kudos
Message 3 of 9
(4,353 Views)

Locking is an internal thing that you don't directly control.  Make sure you aren't leaving a write-transaction open unneccessarily.  You should also look into WAL mode, which allows reading while writing.

0 Kudos
Message 4 of 9
(4,327 Views)

I was following the first example; using the Begin, Perpare, First Step and Reset to "insert" data into the DB.  Where would the "WAL" be set?

0 Kudos
Message 5 of 9
(4,317 Views)
0 Kudos
Message 6 of 9
(4,304 Views)

This link looks to send me to a C Pragma.  How would this get set for the Labview Library?  Is there a VI that exposes these options.  It seems it might be something that gets set during the "opening" process.  But I do not see where the "journal_mode" might be.  Could you suggest which I might try looking into?

 

Thank you so much,

0 Kudos
Message 7 of 9
(4,288 Views)

Try scrolling to the top of the page of the link.  PRAGMAs are set in SQLite by SQL statements, which you execute.  

 

0 Kudos
Message 8 of 9
(4,269 Views)

I have mentioned your suggestion to the team and read more of the details on the SQLite.org page.  Currently the team is hesitant to let me implement the change to the journal_mode WAL. It seems this change is persistent and has an effect on “rollback”. I was also curious if it affects the “commit” well?

If I get the chance I will try and make a small test on a development DB and see what happens.

 

Thank you so much,

 

0 Kudos
Message 9 of 9
(4,181 Views)