System.Data.SQLite
Ticket Change Details
Not logged in
Overview

Artifact ID: 32845f30e5a4db31824929081cfb37bf1f230f61 (Awaiting Moderator Approval)
Ticket: 15d3749655e12f15944e95ef6a026f3613fcdb8a
BusyTimeout property is not used
User & Date: anonymous 2020-06-22 21:06:50
Changes

  1. foundin changed to: "1.0.108.0"
  2. icomment:
    Executing the following code (using Dapper) results in a connection with the BusyTimeout still being the default of 0:
    
    using (var connection = new SQLiteConnection("pathToMyDb...")
    		        {
    			        connection.BusyTimeout = 5000;
    			        connection.Open();
    			        var result = connection.QueryFirstOrDefault("PRAGMA busy_timeout;");
    		        }
    
    I would expect the parameter to actually be used when opening the connection, based on its comment:
    
    ///Gets/sets the default busy timeout to use with the SQLite core library.  This is only used when
    ///opening a connection.
    
    Looking at the source code for the Connection class, it is the Open() method which is resetting the BusyTimeout to 0. In the Open() method, it appears that the property's backing variable is set to an expected connection string parameter. If the connection string doesn't have the parameter for BusyTimeout it is reset to 0. Then, it checks to see if the parameter is not zero when determining whether or not to execute the PRAGMA for setting the BusyTimeout. Any value set via the property is overwritten.
    
  3. login: "anonymous"
  4. mimetype: "text/plain"
  5. private_contact changed to: "9b7eeaf3d8aa5fbf8a2a538e8e8fb1b134cf69b6"
  6. severity changed to: "Important"
  7. status changed to: "Open"
  8. title changed to: "BusyTimeout property is not used"
  9. type changed to: "Code_Defect"