Android Question [jRDC2] Error using new DBRequestManager.bas file

Bladimir Carrillo

Member
Licensed User
Longtime User
Hello,

I was updated to last B4A 8.0 version, and I want to use the new jRDC2. I was downloaded the latest files (jRDC2.zip and DBRequestManager.bas -4KB-) but I am having the following error when trying to send a request to server...

Error B4A Logs section


The code ...

B4X:
    Dim req As DBRequestManager = CreateRequest
    Dim cmd As DBCommand = CreateCommand("sm_tbl_sel", Array(0,0))
    Dim j As HttpJob
    Dim res As DBResult
    
    Try
        j = req.ExecuteQuery(cmd, 0, Null)
        Wait For(j) JobDone(j As HttpJob)

        If j.Success Then
            req.HandleJobAsync(j, "req")
            Wait For (req) req_Result(res As DBResult)
            'work with result
            req.PrintTable(res)
        End If
            
    Catch
        Log(LastException.Message)
    End Try

Error on server side ...


When using old DBRequestManager.bas file (8KB), all works ok but I have not HandleJobAsync method.


Thank you in advance for your help.
 

Alexander Stolte

Expert
Licensed User
Longtime User
dbcommand type
in the main module in "Process_Globals"
B4X:
Sub Process_Globals
   Type DBResult (Tag As Object, Columns As Map, Rows As List)
   Type DBCommand (Name As String, Parameters() As Object)
   Private const rdcLink As String = "http://192.168.0.6:17178/rdc"
End Sub
 
Upvote 0

Bladimir Carrillo

Member
Licensed User
Longtime User
Thank you (DonManfred and Alexander Stolte)

Finally I was found the problem... When I write the Type declarations (DBResult and DBCommand) in other class module that is not main, jRDC do not run.

Other problem I have now...
No all job requests back to the wait ... job in line method. Why ?

For today I am using the old DBRequestManager.bas (on client side) and new jRDC2 jar on server, and runs ok. Obviuslly without asynchronus functionality.


Regards,
Bladimir
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Finally I was found the problem... When I write the Type declarations (DBResult and DBCommand) in other class module that is not main, jRDC do not run.
From this thread (https://www.b4x.com/android/forum/threads/b4xobject-b4a-b4j-b4i-objects-serialization.48272/#content): "Note that if you plan to share types between different platforms then the types should be declared in the main module."

Other problem I have now...
No all job requests back to the wait ... job in line method. Why ?
Example? Code?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…