I am creating a KVS2 database. It gets created and when I add rows with a PUT
The value of Contents is almost always empty in the database. Sometimes (randomly), there will be a valid value.
I've converted to the KeyvalueStore2 class so I could trace the INSERT or REPLACE command and the data is there. I've used TRY/CATCH around the INSERT
and NO ERROR occurs. The Value is correct and contains all 4 items at the point of the ExecNonQuery2.
The write to the table seems to go ok, but when I view the database, the Keys are all there (thus a row per key) but the VALUES are mostly empty...
This works the same way with both the LIBRARY and the CLASS...
Can the ser.convertobjecttobytes(Value) accept a list?
Any ideas or suggestions?
Thanks,
Rusty
B4X:
Sub Class_Globals
Type cntnts(Room As String, ItemType As String, ItemList As List)
Dim Contents As cntnts
Dim ItemNo As Int
End Sub
…
ItemNo = ItemNo + 1
Contents.Room = "RoomA"
Contents.ItemType = "normal"
Contents.ItemList.add("item1")
Contents.ItemList.add("item2")
Contents.ItemList.add("item3")
Contents.ItemList.add("item4")
kvs.Put(ItemNo, Contents)
...
The value of Contents is almost always empty in the database. Sometimes (randomly), there will be a valid value.
I've converted to the KeyvalueStore2 class so I could trace the INSERT or REPLACE command and the data is there. I've used TRY/CATCH around the INSERT
B4X:
Try
sql1.ExecNonQuery2("INSERT OR REPLACE INTO main VALUES(?, ?)", Array (Key, ser.ConvertObjectToBytes(Value)))
Catch
Log(LastException)
End Try
The write to the table seems to go ok, but when I view the database, the Keys are all there (thus a row per key) but the VALUES are mostly empty...
This works the same way with both the LIBRARY and the CLASS...
Can the ser.convertobjecttobytes(Value) accept a list?
Any ideas or suggestions?
Thanks,
Rusty