On Mon, Oct 27, 2014 at 9:58 AM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 27 Oct 2014, at 8:43am, Stephan Beal <sgb...@googlemail.com> wrote:
>
> > - a couple months back Simon suggested ATTACHing the db to itself so that
> > we can effectively alias "main" to the well-known name we have specified
> > for that db instance. It worked like a charm until Dave discovered this
> > weird locking behaviour.
>
> The suggestion I made originally was that sqlite3_open() should open a
> dummy database -- which doesn't need to contain any tables -- as 'main'.
> That way any attached database would never be 'main' too.  However this
> solution was rejected in your case

because introducing a new file into your project 'costs' a lot of work.
>

That was a separate option which i had looked at beforehand, but it's far
from ideal. If we can't get around this locking problem, that might be only
option, but it would require a relatively painful transition of both code
and documentation.

The fact that sqlite behaves one way if we fully qualify the tables and
another if we do not implies that the infrastructure is internally there
for sqlite to figure out "is this the same DB as that one, and if so, don't
lock it." While i'm generally hesitant to say, "bug," it behaving in two
different ways for what is semantically the same code is arguably a bug
(but _which_ of the two behaviours is correct is of course debatable).

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to