[sqlite] Locking Problems with 3.4.1 on Red Hat Linux
Hi, When I create a 3.4.1 SQLite database on Red Hat (2.6.9 kernel) and try to create a table, I get a "database is locked" error. I don't have any problem with a non-NFS filesystem, and I also don't have any problem with version 3.3.3. Does anyone have any hints, or any thoughts on changes that may impact SQLite on NFS? Thanks, -- Andrew Bell [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Locking problems
On 9/23/06, Martin Alfredsson <[EMAIL PROTECTED]> wrote: > > Windows XP, SQLite 3.3.4. > > /Martin > ma1999ATjmaDOTse Martin, did anyone mention virus scanners can lock your database file? Do you have any other processes that might be reading the database file? - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Locking problems
>Usually, the SQLITE_LOCKED means that you tried to prepare or execute a >new SQL statement without resetting or finalizing a previous one on a >single connection. The statements should be prepared and executed this I'm NOT getting SQLITE_LOCKED. The error I get is SQLITE_BUSY (5). For some reason sqlite3_errmsg() returns the string "database is locked" when the error is SQLITE_BUSY. And, yes I have tripplechecked all calls. What I need to know is how to avoid this error and how to ensure the database is not locked when the app exits. /Martin > Hi ! > > I'm getting a lots of "database is locked" (code:5). > > My app keeps giving up on one machine, it might be that > there is a network problem but I not 100% sure. > > Anyway, when the app hangs all the other machines > including the machine where the database file is get > the "database is locked" (code:5) error. > To get rid of the error I have to close my app on all > machines (five total) and sometimes reboot the machine > with the database. As far as I can tell there are no > processes still running. > > The database is as far as I know not corrupted and seems > ok after "restarting the network". > > Why do I get "database is locked" (code:5) and what do I > have to do to avoid it ? > I can try to ensure that there is a try/catch block but > I'm unsure how to unlock the database, Is it enough to > do a sqlite3_close() or do I need to ROLLBACK TRANSACTION > and sqlite3_finalize() before I sqlite3_close() ? > > Windows XP, SQLite 3.3.4. > > /Martin > ma1999ATjmaDOTse > - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Locking problems
Hi ! I'm getting a lots of "database is locked" (code:5). My app keeps giving up on one machine, it might be that there is a network problem but I not 100% sure. Anyway, when the app hangs all the other machines including the machine where the database file is get the "database is locked" (code:5) error. To get rid of the error I have to close my app on all machines (five total) and sometimes reboot the machine with the database. As far as I can tell there are no processes still running. The database is as far as I know not corrupted and seems ok after "restarting the network". Why do I get "database is locked" (code:5) and what do I have to do to avoid it ? I can try to ensure that there is a try/catch block but I'm unsure how to unlock the database, Is it enough to do a sqlite3_close() or do I need to ROLLBACK TRANSACTION and sqlite3_finalize() before I sqlite3_close() ? Windows XP, SQLite 3.3.4. /Martin ma1999ATjmaDOTse Usually, the SQLITE_LOCKED means that you tried to prepare or execute a new SQL statement without resetting or finalizing a previous one on a single connection. The statements should be prepared and executed this way: sqlite3_prepare sqlite3_bind_* sqlite3_step // more sqlite3_steps if there are more statements sqlite3_finalize You can't put another sqlite3_prepare in the middle. If you did, you'll get the database is locked error. And if any error encountered during the process, you should call sqlite3_reset to reset the statement. I suggest that you check your code very carefully to see if any statements are not finalized or resetted. Best regards, He Shiming - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Locking problems
Hi ! I'm getting a lots of "database is locked" (code:5). My app keeps giving up on one machine, it might be that there is a network problem but I not 100% sure. Anyway, when the app hangs all the other machines including the machine where the database file is get the "database is locked" (code:5) error. To get rid of the error I have to close my app on all machines (five total) and sometimes reboot the machine with the database. As far as I can tell there are no processes still running. The database is as far as I know not corrupted and seems ok after "restarting the network". Why do I get "database is locked" (code:5) and what do I have to do to avoid it ? I can try to ensure that there is a try/catch block but I'm unsure how to unlock the database, Is it enough to do a sqlite3_close() or do I need to ROLLBACK TRANSACTION and sqlite3_finalize() before I sqlite3_close() ? Windows XP, SQLite 3.3.4. /Martin ma1999ATjmaDOTse - To unsubscribe, send email to [EMAIL PROTECTED] -