jose isaias cabrera <[EMAIL PROTECTED]>
wrote:
What
I would like to know is, how do I know if I have a db attached
already?
Realize that a set of attached DBs is a property of a connection (a
sqlite3* handle), not some kind of persistent state of the database. You
seem to be under impression that when two processes open the same DB
file, and one process attaches another DB file, the other process can
somehow query SQLite and find out that this happened. This is not the
case.
So, if you want to know if _you_ have attached a DB, just keep track of
ATTACH DATABASE commands you have issued on your connection. If you want
to know if someone else attached a DB to one you also happen to have
open, SQLite can't help you there.
Also, can different clients ATTACH to the same DB and REPLACE unique
RECORDS without any problem?
Well, only one connection can modify a particular database file at the
same time. It doesn't matter if you open the file directly, or attach it
to an existing connection. If two processes attempt the modifying
operation at the same time, one of them will proceed and the other will
be locked out.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------