Originally created by: robert.c...@gmail.com
I used the procedure described by https://code.google.com/p/sqlite4java/issues/detail?id=29 and I am able to run this sqlite wrapper on Android. Which is good!
However, I am having a very strange (to me at least) problem.
My test involves identical databases with BLOB content.... there are 2 attached DBs with the same structure ... they have a table named "media" with just 2 fields, name (text) and content (BLOB). The BLOB content is 1MB worth of binary data.
The 2 tables have one row each only.
The query is very simple:
SELECT * FROM main.media WHERE main.media.name='1024k_02_0.in' UNION SELECT * FROM attached_1.media WHERE attached_1.media.name='1024k_22_1.in'
where "attached_1" is the alias I used when attaching the second database to the main one.
I'm doing SQLiteConnection.prepare() then I'm calling step() from the resulted SQLiteStatement that's all.
Strangely, step() returns a vague error [14] "unable to open database file".
If I repeat the same thing using the sqlite3 tool via adb shell, it works fine (no errors).
The exact same code runs fine on Linux. The exact same code runs fine if the BLOB content stored by the database tables is less than 1MB (works with no errors if it's 200KB or so).
I am using the 2 attached databases in other queries and they all work okay. The problem is when the query uses the tables that have the large BLOB content.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: robert.c...@gmail.com
Here's the error
com.almworks.sqlite4java.SQLiteException: [14] DB[3] step() [SELECT * FROM main.media WHERE main.media.name='1024k_0_0.in' UNION SELECT * FROM attached_1.media WHERE attached_1.media.name='1024k_0_1.in']DB[3][C] [unable to open database file]
at com.almworks.sqlite4java.SQLiteConnection.throwResult(SQLiteConnection.java:1248)
at com.almworks.sqlite4java.SQLiteConnection$BaseController.throwResult(SQLiteConnection.java:1501)
at com.almworks.sqlite4java.SQLiteStatement.stepResult(SQLiteStatement.java:1231)
at com.almworks.sqlite4java.SQLiteStatement.step(SQLiteStatement.java:302)
.......................................
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: robert.c...@gmail.com
Ok I suspect this needs rejected/closed. The problem seems to be outside of sqlite4java's territory. I apologize for that!
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: ser...@gmail.com
Robert, no worries. Thanks for the update.
Since SQLite opens database file every time a transaction starts, it may fail if the file is locked somehow. You can reduce the risk by combining several selects into one transaction with BEGIN statement.
Igor
Labels: -Type-Defect Type-Other
Status: Invalid