Android Question CKVS put, value=SQLite db

pesquera

Active Member
Licensed User
Longtime User
Hi, this post is related to this one:
https://www.b4x.com/android/forum/t...ized-key-value-store.63536/page-3#post-419416

That code does work exellent
But.. I have some issue with just one data file (SQLite db), that can not figure it out

Here is my code:
B4X:
File.Copy(File.DirInternal,"MyDb.db",File.DirDefaultExternal,"MyDb.db")
Dim db() As Byte=Bit.InputStreamToBytes(File.OpenInput(File.DirDefaultExternal,"MyDb.db"))   
Starter.ckvs.Put(Starter.ckvsUser,"MyParam",db)

If I try with another db file, instead of this db file, all is Ok
But.. with this db file I have an error on the Sub HandleQueue into the ClientKVS Class

The error is this:
java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

Debugging into Sub HandleQueue, I can see that the line with the issue is this:
B4X:
 Dim queue_id As Long = rs.GetLong("qid")

Could it be because the size of the db file?

db.Length=360448 on the db file that does work ok
db.Length=2636800 on the db file that has the issue

Thanks for any help
 

DonManfred

Expert
Licensed User
Longtime User
Are you using your own CloudKVS server or are you using the b4a CloudKVS-Server for development?
 
Upvote 0

pesquera

Active Member
Licensed User
Longtime User
I'm using my own server

tested the same code with a couple of another files, does work fine (db and txt files)

trying to see if the size of the db.. I'm using the VACUUM SQLite command without luck (never used it before, guessing from the web)
not sure if the size could be a problem (it has 2.5 Mb)

thanks
 
Upvote 0
Top