SQLite Forum

SQLite WAL mode on vxWorks

SQLite WAL mode on vxWorks

(1) By anonymous on 2020-12-15 08:39:56 [link] [source]

I am trying to configure SQLite into WAL mode using PRAGMA journal_mode=WAL;

However, callback always returns: "journal_mode = delete". All other modes seems to work, but not the WAL mode.

Any ideas why SQLite refuses going into WAL mode? I am using VxWorks 7 and HRFS file system.

(2) By Keith Medcalf (kmedcalf) on 2020-12-16 00:59:22 in reply to 1 [link] [source]

Maybe VxWorks 7 and/or HRFS do not support shared-memory. Have you read the WAL documentation and/or tried setting locking_mode=exclusive before trying to switch to WAL mode?


(3) By anonymous on 2021-02-05 10:14:22 in reply to 2 [link] [source]

Thanks for reply. Setting locking mode to exclusive got me one step forward. 

Seems this is indeed related to shared memory. In SQLite 3.34.0 following is being defined:
  semIoFinder,              /* Finder function name */
  semIoMethods,             /* sqlite3_io_methods object name */
  1,                        /* shared memory is disabled */
  semXClose,                /* xClose method */
  semXLock,                 /* xLock method */
  semXUnlock,               /* xUnlock method */
  semXCheckReservedLock,    /* xCheckReservedLock method */
  0                         /* xShmMap method */

Based on this shared memory would be disabled. However it should be supported by the VxWorks 7. I have used SQLite 3.8.1 with earlier vxWorks version is the past with WAL mode. Either SQLite or VxWorks changes are now preventing me from using WAL mode.

(4) By anonymous on 2021-02-08 12:56:54 in reply to 3 [source]

Answering to myself... Seems previously I have been using version which has built-in shm map function unixShmMap. This function is gone from latest versions and apparently needs to be implemented...