Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5258

Show
Ignore:
Timestamp:
10/09/06 02:02:27 (3 years ago)
Author:
david
Message:

Added timeout option to SQLite3 configurations to deal more gracefully with SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception (closes #6126) [wreese@gmail.com] Added default timeout setting of 5 seconds to SQLite3 database.yml configurations [DHH]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r5256 r5258  
    11*SVN* 
     2 
     3* Added timeout option to SQLite3 configurations to deal more gracefully with SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception #6126 [wreese@gmail.com] 
    24 
    35* Added update_attributes! which uses save! to raise an exception if a validation error prevents saving #6192 [jonathan] 
  • trunk/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb

    r4596 r5258  
    2020          :type_translation => false 
    2121        ) 
     22 
     23        db.busy_timeout(config[:timeout]) unless config[:timeout].nil? 
     24 
    2225        ConnectionAdapters::SQLiteAdapter.new(db, logger) 
    2326      end 
  • trunk/activerecord/test/connections/native_sqlite3/connection.rb

    r4602 r5258  
    1212 
    1313def make_connection(clazz, db_file, db_definitions_file) 
    14   ActiveRecord::Base.configurations = { clazz.name => { :adapter => 'sqlite3', :database => db_file } } 
     14  ActiveRecord::Base.configurations = { clazz.name => { :adapter => 'sqlite3', :database => db_file, :timeout => 5000 } } 
    1515  unless File.exist?(db_file) 
    1616    puts "SQLite3 database not found at #{db_file}. Rebuilding it." 
  • trunk/railties/CHANGELOG

    r5236 r5258  
    11*SVN* 
     2 
     3* Added default timeout setting of 5 seconds to SQLite3 database.yml configurations [DHH] 
    24 
    35* Added generated attribute options to script/generate model, like the one found in scaffold_resource and resource [DHH]. Examples: 
  • trunk/railties/configs/databases/sqlite3.yml

    r3704 r5258  
    44  adapter: sqlite3 
    55  database: db/development.sqlite3 
     6  timeout: 5000 
    67 
    78# Warning: The database defined as 'test' will be erased and 
     
    1112  adapter: sqlite3 
    1213  database: db/test.sqlite3 
     14  timeout: 5000 
    1315 
    1416production: 
    1517  adapter: sqlite3 
    1618  database: db/production.sqlite3 
     19  timeout: 5000