B4J Question RDC CreateCommand UPDATE Error

Declan

Well-Known Member
Licensed User
Longtime User
I cannot understand what I am doing incorrectly.
I must UPDATE a field within my MySQL database.
I have this code:
B4X:
            Dim TrackState As String
            TrackState = "00"
            Dim req As DBRequestManager = CreateRequest
            Dim cmd As DBCommand = CreateCommand ("update_tracking", Array As Object (TrackState, myDeviceID))
            Dim j As HttpJob = CreateRequest.ExecuteBatch(Array(cmd), Null)
            Wait For (req.ExecuteCommand(cmd,Null)) JobDone(j As HttpJob)
            If j.Success Then
                Log("Transaction Successful")
            Else
                Log("ERROR: " & j.ErrorMessage)
            End If
            j.Release

My Config File has:
B4X:
sql.update_tracking=UPDATE devices SET tracking= ? WHERE deviceid= ?;

However, this throws the following error:
B4X:
ResponseError. Reason: Server Error, Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.eclipse.jetty.io.EofException: Closed</title>
</head>
<body><h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-175c2241</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
</html>
ResponseError. Reason: Server Error, Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.eclipse.jetty.io.EofException: Closed</title>
</head>
<body><h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr>
 

OliverA

Expert
Licensed User
Longtime User
I have this code:
change it to
B4X:
            Dim TrackState As String
            TrackState = "00"
            Dim req As DBRequestManager = CreateRequest
            Dim cmd As DBCommand = CreateCommand ("update_tracking", Array As Object (TrackState, myDeviceID))
            Dim j As HttpJob = CreateRequest.ExecuteBatch(Array(cmd), Null)
            Wait For (j) JobDone(j As HttpJob)
            If j.Success Then
                Log("Transaction Successful")
            Else
                Log("ERROR: " & j.ErrorMessage)
            End If
            j.Release
or to
B4X:
            Dim TrackState As String
            TrackState = "00"
            Dim req As DBRequestManager = CreateRequest
            Dim cmd As DBCommand = CreateCommand ("update_tracking", Array As Object (TrackState, myDeviceID))
            Wait For (CreateRequest.ExecuteBatch(Array(cmd), Null)) JobDone(j As HttpJob)
            If j.Success Then
                Log("Transaction Successful")
            Else
                Log("ERROR: " & j.ErrorMessage)
            End If
            j.Release
 
Upvote 0

Declan

Well-Known Member
Licensed User
Longtime User
change it to
B4X:
            Dim TrackState As String
            TrackState = "00"
            Dim req As DBRequestManager = CreateRequest
            Dim cmd As DBCommand = CreateCommand ("update_tracking", Array As Object (TrackState, myDeviceID))
            Dim j As HttpJob = CreateRequest.ExecuteBatch(Array(cmd), Null)
            Wait For (j) JobDone(j As HttpJob)
            If j.Success Then
                Log("Transaction Successful")
            Else
                Log("ERROR: " & j.ErrorMessage)
            End If
            j.Release
or to
B4X:
            Dim TrackState As String
            TrackState = "00"
            Dim req As DBRequestManager = CreateRequest
            Dim cmd As DBCommand = CreateCommand ("update_tracking", Array As Object (TrackState, myDeviceID))
            Wait For (CreateRequest.ExecuteBatch(Array(cmd), Null)) JobDone(j As HttpJob)
            If j.Success Then
                Log("Transaction Successful")
            Else
                Log("ERROR: " & j.ErrorMessage)
            End If
            j.Release
Same error:
B4X:
ResponseError. Reason: Server Error, Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.eclipse.jetty.io.EofException: Closed</title>
</head>
<body><h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-175c2241</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
</html>
ERROR: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.eclipse.jetty.io.EofException: Closed</title>
</head>
<body><h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-175c2241</td></tr>
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
What is the error message on the server side? What is displayed in the DOS box?
 
Upvote 0

Declan

Well-Known Member
Licensed User
Longtime User
Above code works.
I found a bizarre case:
I changed:
B4X:
sql.update_tracking
in the RDC Config to:
B4X:
sql.set_tracking
and all works great.
 
Upvote 0
Top