sqlite database locking

0

Hello!

I've been working on utilizing Powershell Universal Dashboard to create a web interface for PDQ for my IT department to use, but I've been running into some issues with the sql database locking. I've modeled my code after something like this: https://www.pdq.com/blog/export-custom-fields-pdq-inventory-using-powershell-sqlite/

Unfortunately, seemingly at random the code will fail with an error saying that the database is locked. If I'm running the script on my machine, there's a process called "SQLite is an in-process library that implements..." that I cannot end and I usually have to restart the computer, or the PDQ Inventory/Deploy service on the server.

My query looks like this: ActivePackages = (sqlite3.exe "\\(PDQ Server)\C\ProgramData\Admin Arsenal\PDQ Deploy\Database.db" "SELECT DeploymentID, PackageName, Status FROM Deployments WHERE Status <> 'Finished';")

Should I be formatting this in a different way, or is there a setting I can change to eliminate these random database locks?

Cancel
login to comment
0

I believe I have now fixed the issue by changing the code to: sqlite3.exe -cmd ".bail ON" "\(PDQ Server)\C$\ProgramData\Admin Arsenal\PDQ Deploy\Database.db" "SELECT DeploymentID, PackageName, Status FROM Deployments WHERE Status <> 'Finished';"

Cancel
login to comment

Reply