I have some code below (2nd line) that seems to have an underline saying types do not match, I can't see why, and it does not seem to work... It just freezes the app and I can't see where it goes
B4X:
Sub InsertLolerRequest
Dim cmd As DBCommand = CreateCommand("insert_req_loler_31298", Array(1,0,1,Main.lngLolerKitID))
Dim j As HttpJob = CreateRequest.Executebatch(cmd, Null)
Wait For(j) JobDone(j As HttpJob)
If j.Success Then
Log("Inserted successfully!")
End If
j.Release
end sub
Any help would be appreciated, writing in b4a 10.0
It appears it is not waiting.... If I put in some code and add a break point in JobDone, it goes through and pauses there. Is there a reason why it would not wait and then execute the lines below? I checked the SQL table, and it is actually writing to the table ok.
1/ Click onExecuteBatchin IDE, see what the hint help says it returns. Error indicates is returning String, which is usually the default if not otherwise specified. Should be As HttpJob.
2/ Make sureExecuteBatchis defined in your project, probably in file DBRequestManager.bas from:
Public Sub ExecuteBatch(ListOfCommands As List, Tag As Object) As HttpJob
Dim j As HttpJob = CreateJob
ExecuteBatchImpl(j, ListOfCommands, Tag)
Return j
End Sub
My public sub did not have the As HttpJob on the end, but I have not changed anything, do you think I am on an old version somehow? Mine is as below, looks nothing like yours
My Version of Execute batch:
Public Sub ExecuteBatch(ListOfCommands As List, Tag As Object)
Dim ser As B4XSerializator
ser.Tag = Tag
ser.ConvertObjectToBytesAsync(CreateMap("commands": ListOfCommands, "version": VERSION), "ser")
End Sub