Closed jmugan closed 1 year ago
Hello,
UnQLite implements the Multiple readers, single writer paradigm, so while it OK for multiple process/threads to read the same database at once, only a single writer thread/process is allowed to write to the database at once. Your other process (hence the writer) must call unqlite_commit()
in order to release the exclusive lock, and let other processes access the database again.
Thanks for your response. There is only one writer and it does call commit. The other process is a reader not controlled by me. Is there anything I can do, like "hey, close any open sessions because I know they are readers and I'm the only writer."
I'll also look in the documentation more. Maybe I don't understand how unqlite decides to open a transaction. It seems more implicit than I'm used to.
Yes,
If your first read fail, just implement a timing loop (think of asyncio) that calls the database read function periodically until it succeed.
-----Original Message----- From: Jonathan Mugan @.> To: symisc/unqlite @.> Cc: PixLab | Symisc Systems @.>, State change @.> Sent: Sat, 11 Mar 2023 3:51 Subject: Re: [symisc/unqlite] Cannot acquire an exclusive lock on the database while journal rollback (Issue #148)
Thanks for your response. There is only one writer and it does call commit. The other process is a reader not controlled by me. Is there anything I can do, like "hey, close any open sessions because I know they are readers and I'm the only writer."
-- Reply to this email directly or view it on GitHub: https://github.com/symisc/unqlite/issues/148#issuecomment-1464244780 You are receiving this because you modified the open/close state.
Message ID: @.***>
Hi, I get this error. Normally, I guess you would restart the database when it gets into a weird state like this, but for unqlite there is nothing to restart. What should I do?
I have another process that reads the database. Is it you can't have one process read the database and another write to it?
Here's the full stack trace