Re: [sqlite] After upgrade from sqlite3 3.8.7.4 to anything after 3.14.1, I get "Error: destination database is in use"

2018-08-21 Thread Richard Hipp
O it looks to me like the
> 'exclusive' command just needs to be removed ... the threadsafe option that
> sqlite3 was built with looks like it is internally handling the locking.

That would be my guess too.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] After upgrade from sqlite3 3.8.7.4 to anything after 3.14.1, I get "Error: destination database is in use"

2018-08-21 Thread Brian Hutchinson
Is this question better suited for the development list? No response at all.

Thanks,

Brian
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] After upgrade from sqlite3 3.8.7.4 to anything after 3.14.1, I get "Error: destination database is in use"

2018-08-10 Thread Brian Hutchinson
Running sqlite3 in an embedded Linux distributed environment.

Sqlite3 was built with Yocto and configured to be threadsafe.

One box keeps a master database and periodically will rsync the database to
remote boxes and send them a message to "update" their database.

When "update" message is received by the remote boxes, they run a bash
script that runs .restore command to restore database from the file that
was rsync'd .  This all ran fine back in 3.8.7.4 days but newer builds
(first discovered in 3.14.1) return a "Error: destination database is in
use" message when .restore is ran.

The contents of the script basically boil down this CLI set of commands
that illustrate the issue:

sqlite3 myTestDb
sqlite> CREATE TABLE table1 (myId INTEGER PRIMARY KEY, myName TEXT);
sqlite> INSERT INTO table1 (myName) VALUES ('brian');
sqlite> select * from table1;

returns 1|brian

sqlite> .exit

sqlite3 myTestDb2
sqlite> begin exclusive;
sqlite> .restore myTestDb
Error: destination database is in use

From looking at the commits it looks to me like threadsafe build enforces
extra locking requirements.

I didn't write the restore bash script but it looks to me like the
'exclusive' command just needs to be removed ... the threadsafe option that
sqlite3 was built with looks like it is internally handling the locking.
But I'm not 100% sure and don't know if there is another way of handling
this.  It's just one of those things that "this used to work and now it
doesn't" after a sqlite3 version upgrade so not sure what to do.

Thanks for any suggestions or insight.

Regards,

Brian
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users