Unable to open database
Posted: Thu Jun 23, 2011 11:33 pm
An oddity I'd like to understand for my general fund of knowledge...
I have an SQLite database that I am successfully connecting to and retrieving data from.
I have written an import routine that takes a tab-delimited file, parses it, builds an INSERT statement, and executes the statement, thereby inserting the data from a line in the import file into the database.
For the most part the import works, but at seemingly random points while doing the inserts it fails with 'Unable to open the database file'. In an approximately 800-line file this can happen anywhere, but usually somewhere near the middle-ish, say line 300-something, or 400-something.
After this error, attempting to rerun the import gets the error on the very first line (and every subsequent line since I'm not doing an abort).
The only way I've found to be able to continue the import is to close LC and relaunch it, and split my import file at the location it stopped.
There seems to be some kind of file-locking/inaccessibility thing going on, but I haven't a clue why.
Any thoughts?
EDIT: to correct the text of the error message.
I have an SQLite database that I am successfully connecting to and retrieving data from.
I have written an import routine that takes a tab-delimited file, parses it, builds an INSERT statement, and executes the statement, thereby inserting the data from a line in the import file into the database.
For the most part the import works, but at seemingly random points while doing the inserts it fails with 'Unable to open the database file'. In an approximately 800-line file this can happen anywhere, but usually somewhere near the middle-ish, say line 300-something, or 400-something.
After this error, attempting to rerun the import gets the error on the very first line (and every subsequent line since I'm not doing an abort).
The only way I've found to be able to continue the import is to close LC and relaunch it, and split my import file at the location it stopped.
There seems to be some kind of file-locking/inaccessibility thing going on, but I haven't a clue why.
Any thoughts?
EDIT: to correct the text of the error message.