Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error (RT) in LogErrors: failed. Sqlite error 5
#2
Error if multiple threads write simultaneously to the same database. Need to lock.

This test code runs 2 threads that write to the same database. Error if without lock.

Macro Macro1704
Code:
Copy      Help
rep 2
,mac "sqlite_thread"

Function sqlite_thread
Code:
Copy      Help
str dbfile="$desktop$\test.db3"
rep 10
,lock log_err_sqlite "Global\QM_log_err_sqlite"
,Sqlite db1.Open(dbfile)
,db1.Exec("CREATE TABLE IF NOT EXISTS table1 (A,B)")
,db1.Exec(F"INSERT INTO table1 VALUES ('one','two')")
,db1.Close
,lock- log_err_sqlite


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)