0

I am having an issue that I cannot see to find a solution to.

We have a small server application that pings a GPS Server every 1o seconds and writes the values to two tables. Firstly GPSLive, secondly GPSLog. The server application reports the last time the data was updated for each table.

The client application reads GPSLive to draw a GPS map of the vehicles. The client checks the timestamp of the GPSLive table and compares it against the current time and warns the user that the data may not be current.

At the moment 18:12:22 the server has updated both rows at 18:11:59. However, the client is showing that the data is 16 minutes old.

The GPSLive table has a single row and is overwritten at every update. This happens regularly and will then catch up. The system runs on our local LAN only and at most has a handful of users. When I look at GPSLive via workbench I can see the timestamp hasn't updated.

Is there anything I can do to fix this behaviour?

Edit: Added Code

    Public Sub AddtoGPSLive(JSONString As String)
    Dim sql As String = "Update GPSLive Set GPSJSON=@J Where ID=1"
    Using con As New MySqlConnection(My.Settings.BMConnString)
        Using cmd As New MySqlCommand(sql, con)
            con.Open()
            cmd.Parameters.AddWithValue("@J", JSONString)
            Dim i As Integer = 0
            i = cmd.ExecuteNonQuery
            If i > 0 Then
                txtLastLive.Text = Now
            End If
        End Using
    End Using
End Sub
  • What is the setting of autocommit? Do you do the updates inside a transaction? – Rick James Sep 6 at 18:28
  • I am not sure what setting autocommit is, I havent changed away from the default value. We dont use transactions. The code has been added above. – Dave B Sep 9 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.