Update Timeout
(1) By anonymous on 2021-03-09 10:21:49 [source]
Hallo ich bin Karl und programmiere vb.net mit Sqlite. Habe eiene einfache Tabelle mit id und einer Spalte. Wenn ich einen update mache auf die Spalte funktioniert es, wenn ich den Update sofort danach wiederhole geht der Execut-Befehl in den Timeout. Hier mein Code:
Seingabe = InputBox("Bitte Abteilungsbezeichnung ändern", "Abteilung", SQLreader(1))
If Seingabe <> "" Then
On Error Resume Next
MessageBox.Show(" Seingabe = " & Seingabe)
SSS = eingabe
SQLcommand = SQLconnect.CreateCommand
SQLcommand.CommandText = "UPDATE Abteilungen Set Abteilung =" & "'" & Seingabe & "'" & " WHERE Abteilungen.id = " & Tind
SQLcommand.ExecuteNonQuery()
End If
SQLconnect.Close()
AbfrageAbteilung()
End Sub
(2) By Stephan Beal (stephan) on 2021-03-09 11:44:55 in reply to 1 [link] [source]
Hallo ich bin Karl und programmiere vb.net mit Sqlite.
Hi Karl. Hier wird vorzugsweise Englisch gesprochen, so hier eine Uebersetzung fuer alle anderen:
(Abbreviated English translation of Karl's post:)
Using vb.net I have a simple table with an ID and one column. When I update the column once, it works, but when I repeat the update a second time, the Execute command times out. Here's the code:
@Karl i suspect that the problem is that you are disconnecting your db connection near the end of the function (SQLconnect.Close()
), but i'm not familiar with vb.net so might be misunderstanding that API.
(3) By Gunter Hick (gunter_hick) on 2021-03-09 12:14:56 in reply to 1 [link] [source]
A single threaded program should be using only a single SQLite connection. You seem to be opening and closing connections inside each and every function. That is not only a waste of effort, but you are probably leaking connections with open transactions (probably in the AbfrageAbteilung function), that prevent the next write transaction from going through.