One of my routines starts by counting records in a MariaDB database on a NAS.
In my Activity-based version, it has been working for many years, and still does.
In my B4XPages version, the HTTP Job returns an empty string.
I wrote a small test routine to eliminate some variable factors, and then added the code to both versions of the app and tested them. The code is:
In both cases this code is run in a service.
In the Activity-based version this test code is called from an Activity Module called TMM_DBUpdates.
In the B4XPages version it is called from a B4X page class called B4XPTMM_DBUpdates.
In both cases, the calling code is simply:
The result in the log when the Activity version is run is:
The result in the log when the B4XPages version is run is
So the B4XPages version only returns an empty string. The database and connections used are all identical. (unless I have missed something). A routine that deletes all the records in one of the database tables (that doesn't return a string) runs properly in both versions of the app, which would suggest that the connection string with passwords etc is properly set up.
What am I missing here?
In my Activity-based version, it has been working for many years, and still does.
In my B4XPages version, the HTTP Job returns an empty string.
I wrote a small test routine to eliminate some variable factors, and then added the code to both versions of the app and tested them. The code is:
B4X:
Sub Test_Job
Dim cmd As String = "Select COUNT(*) FROM pieces WHERE PrimaryGroup like 'PG_%';"
Dim Job As HttpJob
Job.Initialize("", Me)
Job.PostString(cmTMM.gsMySQLLink & sConnection, cmd)
Wait For (Job) JobDone(Job As HttpJob)
If Job.Success Then
LogColor($"Success - Job.Getstring is: ${Job.Getstring}"$, Colors.Magenta)
Else
LogColor($"Not Successful"$, Colors.Red)
End If
Job.Release
End Sub
In the Activity-based version this test code is called from an Activity Module called TMM_DBUpdates.
In the B4XPages version it is called from a B4X page class called B4XPTMM_DBUpdates.
In both cases, the calling code is simply:
B4X:
CallSub(TMM_DBService,"Test_Job")
B4X:
Success - Job.Getstring is: [{"COUNT(*)":"8595"}]
B4X:
Success - Job.Getstring is:
What am I missing here?