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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

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
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

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

Brian Hutchinson
Is this question better suited for the development list? No response at all.

Thanks,

Brian
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

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

Richard Hipp-3
In reply to this post by Brian Hutchinson
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
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users