I am very new to python (2 days study) although not a novice developer.
I want to create three processes that access the same table in a sqlite database; two will read and write, the other only write.
I note that the sqlite connection object will raise an exception if multiple threads try to access it at the same time. I want multiple processes to use three different connectors to access the same table...
Can anyone suggest how I can manage this?
I presume I will need to implement some form of locking and waiting mechanism but I don't know how to implement it and I don't seem to be able to find any examples online.
The table will be a messages table and the processes -
[*]Listener (Will write incoming messages to the table)
[*]State machine (Will read and write messages)
[*]Sender (Will read messages from the table for transmission and update the status column)
I understand how to create the three separate processes and instantiate connections from each. I am just looking for advice on how to handle getting an exclusive lock for each on the database. i.e. How do I detrmine if another process has made a connection at any given instant so that I can implement a wait for lock?
Thanks for any help in advance.
Last edited by stranac
on Tue Dec 31, 2013 2:32 pm, edited 1 time in total.
Reason: First post lock.