SQLiteDatabase.OpenParams.Builder.SetIdleConnectionTimeout(Int64) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the maximum number of milliseconds that SQLite connection is allowed to be idle before it is closed and removed from the pool.
[Android.Runtime.Register("setIdleConnectionTimeout", "(J)Landroid/database/sqlite/SQLiteDatabase$OpenParams$Builder;", "", ApiSince=27)]
public Android.Database.Sqlite.SQLiteDatabase.OpenParams.Builder SetIdleConnectionTimeout(long idleConnectionTimeoutMs);
[<Android.Runtime.Register("setIdleConnectionTimeout", "(J)Landroid/database/sqlite/SQLiteDatabase$OpenParams$Builder;", "", ApiSince=27)>]
member this.SetIdleConnectionTimeout : int64 -> Android.Database.Sqlite.SQLiteDatabase.OpenParams.Builder
Parameters
- idleConnectionTimeoutMs
- Int64
timeout in milliseconds. Use Long.MAX_VALUE to allow unlimited idle connections. Value is 0 or greater
Returns
- Attributes
Remarks
This method was deprecated in API level 29. DO NOT USE this method. See the javadoc for the details.
Sets the maximum number of milliseconds that SQLite connection is allowed to be idle before it is closed and removed from the pool.
DO NOT USE this method. This feature has negative side effects that are very hard to foresee.
A connection timeout allows the system to internally close a connection to a SQLite database after a given timeout, which is good for reducing app's memory consumption. However the side effect is it will reset all of SQLite's per-connection states, which are typically modified with a PRAGMA statement, and these states will not be restored when a connection is re-established internally, and the system does not provide a callback for an app to reconfigure a connection. This feature may only be used if an app relies on none of such per-connection states.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.