On 18 Nov 2009, at 8:38pm, priimak wrote:

> I understand that. However, that would not present a problem if I access 
> database by its symlink for reading only and database directly if I am 
> updating isn't?

According to the documentation that could be a problem.  The update application 
creates a journal file in the directory where the database file actually is.  
The application which reads the database file looks for a journal in the 
directory where the alias is, and doesn't find it.

Please note that I haven't read the source code for sqlite3, and I don't know 
if that's really how it works.

> By the way the reason for that usage ( though there are work arounds ) 
> is that I keep two instances of db file a.db.1 and a.db.2 with symlink 
> a.db pointing to one or there db file. If a.db -> a.db.1 I apply update 
> to a.db.2, swap symlink and then update a.db.2. Symlink a.db used by 
> webapp, which performs *only* select queries.

Rather than use a symbolic link, store something in the database files 
themselves which says which one is being updated.  Or use two different tables 
in the same database file.

I understand your use of symbolic links and it makes sense with atomic files -- 
files where you open the file, read the whole thing, then close it.  But it 
would seem to be a problem with SQLite files.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to