Ok I was able to make some progress on this issue. Per Richard's
recommendation I hooked into the error callback and started seeing errors
like this (original sql statement removed from log output since it is not
important here):

SqliteLibrary::Log( Error=14, Message="cannot open file at line 28203 of
[527231bc67]" )
SqliteLibrary::Log( Error=14, Message="os_unix.c:28203: (30)
open(./etilqs_xetmTmd7oYLmidY) - " )
SqliteLibrary::Log( Error=14, Message="statement aborts at 36: [<statement
here>] " )
It looks like Richard's initial hypothesis turns out to be true, SQLite is
trying to create temporary files in "." which doesn't work on Android, so
it fails. I have since tried to find out what the correct way is to point
SQLite to the right place for creating temporary files in Android, with no
luck.

There was a bug in Google Chrome regarding the same issue, and the solution
they chose was to use -DSQLITE_TEMP_STORE=3 to force temporary file
creation in memory for the same reason.

I found the PRAGMA temp_store_directory in the docs but unfortunately it
says this pragma is deprecated and using it is discouraged.

Right now it looks like my options are either going the memory only way as
well or using a deprecated pragma to set the temp directory to where my
Android app can actually write.

Any other ideas?

// Sascha




On Fri, Oct 4, 2013 at 3:10 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Fri, Oct 4, 2013 at 2:55 PM, Sascha Sertel <sascha.ser...@gmail.com
> >wrote:
>
> >
> > I'm working on a multi-platform app that uses a cross-platform library
> with
> > SQLite 3.7.16.1 built into it (i.e. not using the built-in SQLite version
> > in Android or other platforms). We make (re)use of prepared statements
> for
> > INSERT and UPDATE on the database, and we use FULLMUTEX serialized
> > threading mode. We use explicit transactions for some bulk INSERT
> > operations, but most other calls use implicit transactions.
> >
> > Everything worked fine until I switched journal_mode from MEMORY to WAL.
> > Now when I run the app I started seeing SQLite errors pop up, the first
> > error is
> >
> >
> > sqlite3_step failed: unable to open database file (error code: 14)
> >
>
>
> Please activate the error and warning log (
> http://www.sqlite.org/errlog.html)
> and let us know what you see there.
>
> One possible problem:  SQLite needs to create a temporary file so that a
> multi-row update can be backed out if a constraint fails, but you are out
> of temporary file space, or maybe you don't have access rights on the
> temporary file space.
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to