Are you using vista or win7 ? I've had pretty much the same issue when my .db file was in a 'protected' folder (eg C:\, c:\windows, etc). Otherwise, check file permissions, is it readonly, that kind of thing. Good luck
Chris Hulbert -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of ramakrishna menon Sent: Monday, 12 July 2010 4:20 AM To: [email protected] Subject: [SQLiteJDBC] Question on sqlite jdbc wrapper Hi folks I am new to the sqlite world. I decided to use sqlite for a light weight file based queue. I decided to use the sqlitejdbc mainly because I wanted a clean wrapper over original sqlite implementation. My requirement is that the database access can be restricted to only one thread at a time (reader or writer). I do have multiple threads but I use a sempahore at the point of getting a connection and closing a connection to ensure that only one thread can access the file. My program fails consistently at the same point. This is the thread that selects "unprocessed" entries from the queue table, processes them (a non sqlite operation) and then marks the rows as processed. It always fails at the point of commit that happens right after the update statement that runs to mark the rows as "processed". The error is always java.sql.SQLException: database is locked at org.sqlite.DB.throwex(DB.java:288) at org.sqlite.DB.exec(DB.java:68) at org.sqlite.Conn.commit(Conn.java:172) Can this happen even if I guarantee that only one thread is accessing db file at a time? I also ensure that I am not accessing it from outside the program (eg using sqlite3.exe) I am running my tests in Windows though the final deployment would be on Linux (mentioning it in case this is a windows only issue, then it is ok.) Any help on this would be appreciated. Menon _______________________________________________ SQLiteJDBC mailing list [email protected] https://lists.hcoop.net/listinfo/sqlitejdbc *********************************************************** CAUTION: This email and files included in its transmission are solely intended for the use of the addressee(s) and may contain information that is confidential and privileged. If you receive this email in error, please advise us immediately and delete it without copying the contents contained within. Woolworths Limited (including its group of companies) do not accept liability for the views expressed within or the consequences of any computer viruses that may be transmitted with this email. The contents are also subject to copyright. No part of it should be reproduced, adapted or transmitted without the written consent of the copyright owner. *********************************************************** _______________________________________________ SQLiteJDBC mailing list [email protected] https://lists.hcoop.net/listinfo/sqlitejdbc
