B4J Question How to implement ExecuteBatch2 & Transactions with jRDC2?

Widget

Well-Known Member
Licensed User
Longtime User
How do I use RDCHandler.ExecuteBatch2 in jRDC2? I would like to send multiple commands at a time to minimize the HTTP traffic. Can someone give me an example or a link on how to do this?

This will also allow me to use transactions to speed up inserting a lot of rows.

TIA
 

XbNnX_507

Active Member
Licensed User
Longtime User
B4X:
    Dim list_of_commands As List
    list_of_commands.Initialize
    For  i = 0 To 100 ' amout of commands to send
        Dim cmd As DBCommand
        cmd.Initialize
        cmd.Name = "yourSQL" 'your nonQuery command name specified in config.properties
        cmd.Parameters = Array( ) ' your parameters
        list_of_commands.Add( cmd )
    Next
    Wait For ( yourRDCHandler.ExecuteBatch( list_of_commands , "") ) JobDone( j As HttpJob )
    If j.Success Then
        yourRDCHandler.HandleJobAsync(j, "req")
        Wait For ( yourRDCHandler) req_Result ( result As DBResult )
        Log ( result )
    End If
Client side.
 
Upvote 0
Top