Hi all.
i have one question. when i update DB and after few second i retry with SELECT date the service give me OLD VALUE.
This is code Service:
i execute the firsrt Query in Start_service
This query excute another query (
) the first time all work. After also if i update DB comeback OLD VALUE.
Any Idea ??
Thank you
i have one question. when i update DB and after few second i retry with SELECT date the service give me OLD VALUE.
This is code Service:
B4X:
Sub Service_Start
'Rileggo dal DB
sPhonenum = pId.GetLine1Number
ExecuteRemoteQuery("SELECT numeroconsole from spy where numerospy ='" & sPhonenum & "'", SPY)
End Sub
.......
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim res As String
res = Job.GetString
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Select Job.JobName
'Seleziono Lista Numeri
Case SPY
Dim l As List
l = parser.NextArray
If l.Size = 0 Then
numero_autorizzato = "000000000"
Else
Dim m As Map
m = l.Get(0)
numero_autorizzato = m.Get("numeroconsole")
'Prelevo i secondi sul conto
ExecuteRemoteQuery("SELECT secondi from ricarica_spy where numero ='"& numero_autorizzato &"'", RICARICA_SPY)
End If
'Prelevo tramite la query di sopra i secondi rimasti
Case RICARICA_SPY
Dim l As List
l = parser.NextArray
If l.Size = 0 Then
secondi_disponibili = 0
Else
Dim m As Map
m = l.Get(0)
secondi_disponibili = m.Get("secondi")
secondi_disponibili = secondi_disponibili * 1000
ToastMessageShow("MilliSecondi rimasti: "& secondi_disponibili, True)
End If
End Select
Else
ToastMessageShow("Error: " & Job.ErrorMessage & "Errore Internet", True)
End If
Job.Release
End Sub
i execute the firsrt Query in Start_service
B4X:
ExecuteRemoteQuery("SELECT numeroconsole from spy where numerospy ='" & sPhonenum & "'", SPY)
This query excute another query (
B4X:
ExecuteRemoteQuery("SELECT secondi from ricarica_spy where numero ='"& numero_autorizzato &"'", RICARICA_SPY
Any Idea ??
Thank you