SQLiteDatabase.ThreadYieldInterval

From Xojo Documentation

Revision as of 15:47, 12 November 2019 by PLefebvre (talk | contribs) (Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Property (As Integer )
aSQLiteDatabase.ThreadYieldInterval = newIntegerValue
or
IntegerValue = aSQLiteDatabase.ThreadYieldInterval

Supported for all project types and targets.

Yields time back to your application every N virtual machine instructions. The unit is virtual machine instructions.

Notes

A value of zero means disabled. Higher values mean less time to your applications and more time to SQLite. There is no "best" value to use, since one cannot know in advance how many virtual machine instructions are required in order to execute an SQL statement. If performance is a problem, the user should try different values and use among the ones that work well for their application.

In most situations you should not need to change this value from its default of 0.

Example

This example sets the value of ThreadYieldInterval. Please keep in mind that users need to experiment to find a good value for their case.

Var dbFile As New FolderItem("MyDB.sqlite")

Var db As New SQLiteDatabase
db.DatabaseFile = dbFile

db.ThreadYieldInterval = 200

Try
db.Connect
// Key was correct; DB is connected
MessageBox("Connected to database.")
Catch error As DatabaseException
MessageBox("Connection error: " + error.Message)
End Try