B4J Question [WebApp] MySQL connection time out

Fabrice La

Active Member
Licensed User
Longtime User
I have couple of ResultSet in my WebServer appli after some time to play with it I have :
(all my ResultSet are closed)
 

Fabrice La

Active Member
Licensed User
Longtime User
The probleme of time out come from this :
B4X:
Sub btchange_Click (Params As Map)
    Main.AppLog("btchange :: Start")
    Dim request As HttpRequest
    Dim m As ResultSet
    Dim tmpfrom As String = "r"
    Dim tmpto As String = "r"
    m = DB.pool.GetConnection.ExecQuery("SELECT devises FROM devise WHERE id = " & DefCurr)
    Do While m.NextRow
        tmpfrom = m.GetString("devises")
    Loop
    m.Close
    Log("Premier")
    If tmpfrom <> "r" Then
        m = DB.pool.GetConnection.ExecQuery("SELECT devises FROM devise WHERE id = " & Curr) ' Time out here
        Log("Deuxieme")
        Do While m.NextRow
            tmpto = m.GetString("devises")
        Loop
        m.Close
        DB.pool.GetConnection.Close
        Main.AppLog(URL & tmpfrom.SubString2(0,3) & "&ToCurrency=" & tmpto.SubString2(0,3))
        request.InitializeGet(URL & tmpfrom.SubString2(0,3) & "&ToCurrency=" & tmpto.SubString2(0,3))
        request.Timeout = 10000 
        If HttpClient1.Execute(request, 1) = False Then Return 
    End If
    Main.AppLog("btchange :: End")
End Sub

Why ?
 
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
Thanks I fix the probleme.

Why am I using jHttpUtils2 because it come from my appli in B4J (no WebAppli). Do I have an other solution ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…