As already stated, this looks like you have at least one transaction underways. Your schema change will become visible only after
1) they are committed on ther "writer" connection AND 2) a new transaction is started on the "reader" connection If your "readers" are failing to reset or finalize any of their statements, the corresponding connection will have an active transaction that you may be unaware of and that prevents the schema change being seen. For diagnostic purposes ONLY, try opening with shared cache enabled and execute pragma read_uncommitted. If the problem goes away, then you are keeping transactions open longer than you think. -----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Ben Asher Gesendet: Freitag, 16. August 2019 21:49 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: [EXTERNAL] Re: [sqlite] Schema updates across threads in WAL & multithread mode To clarify, we add a column on our writer connection, and then "SELECT * FROM table" on the reader connection does not include the column that was added. Ben On Fri, Aug 16, 2019 at 11:32 AM Ben Asher <benashe...@gmail.com> wrote: > Hi folks! We're running (sqlite 3.27.2) into an issue where we make a > schema update (adding a column to a table) on our writer connection, > but then the schema update isn't immediately available on the > read-only connections that we use on other threads, which causes a > crash in our application (app expects the column to exist at that > point). I've verified that the column does indeed get added, and > everything works fine after restarting the application (i.e. all > connections loaded fresh pickup the schema update). > > Is there something we need to do proactively to ensure that schema > update appears immediately from other threads? > > Some notes about our setup: > > sqlite 3.27.2 > Using multithread mode (SQLITE_OPEN_NOMUTEX) Using WAL mode > > Thanks! > > Ben > -- Ben _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0 May be privileged. May be confidential. Please delete if not the addressee. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users