Joanne Pham <[EMAIL PROTECTED]> wrote:
> I read the online document regarding "Table Level Locking" as below:
> At any one time, a single table may have any number of active
> read-locks or a single active write lock. To read data a table, a
> connection must first obtain a read-lock. To write to a table, a
> connection must obtain a write-lock on that table. If a required
> table lock cannot be obtained, the query fails and SQLITE_LOCKED is
> returned to the caller
> So the question that I had is while writing the data to table(write
> lock) another process can read the data from same table without any
> problem?

The article you quote applies to connections that have opted into shared 
cache. Only connections in the same process can share cache. Connections 
from different process use the traditional file-level locking.

Even connections with shared cache cannot read and write the same table 
simultaneously (unless you also turn on "read uncommitted" option). 
Consider the passage you yourself have just quoted: "at any one time, a 
single table may have any number of active read-locks *OR* a single 
active write lock" (emphasis mine).

Igor Tandetnik 



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

Reply via email to