rails/activerecord/CHANGELOG.md
Matthew Draper 9e457a8654 Reap connections based on owning-thread death
.. not a general timeout.

Now, if a thread checks out a connection then dies, we can immediately
recover that connection and re-use it.

This should alleviate the pool exhaustion discussed in #12867. More
importantly, it entirely avoids the potential issues of the reaper
attempting to check whether connections are still active: as long as the
owning thread is alive, the connection is its business alone.

As a no-op reap is now trivial (only entails checking a thread status
per connection), we can also perform one in-line any time we decide to
sleep for a connection.
2014-03-18 10:33:00 +10:30

3.6 KiB

  • Reap connections that were checked out by now-dead threads, instead of waiting until they disconnect by themselves. Before this change, a suitably constructed series of short-lived threads could starve the connection pool, without ever having more than a couple alive at the same time.

    Matthew Draper

  • where.not adds references for includes like normal where calls do.

    Fixes #14406.

    Yves Senn

  • Extend fixture $LABEL replacement to allow string interpolation.

    Example:

    martin:
      email: $LABEL@email.com
    
    users(:martin).email # => martin@email.com
    

    Eric Steele

  • Add support for Relation be passed as parameter on QueryCache#select_all.

    Fixes #14361.

    arthurnn

  • Passing an Active Record object to find is now deprecated. Call .id on the object first.

  • Passing an Active Record object to find or exists? is now deprecated. Call .id on the object first.

  • Only use BINARY for MySQL case sensitive uniqueness check when column has a case insensitive collation.

    Ryuta Kamizono

  • Support for MySQL 5.6 fractional seconds.

    arthurnn, Tatsuhiko Miyagawa

  • Support for Postgres citext data type enabling case-insensitive where values without needing to wrap in UPPER/LOWER sql functions.

    Troy Kruthoff, Lachlan Sylvester

  • Only save has_one associations if record has changes. Previously after save related callbacks, such as #after_commit, were triggered when the has_one object did not get saved to the db.

    Alan Kennedy

  • Allow strings to specify the #order value.

    Example:

    Model.order(id: 'asc').to_sql == Model.order(id: :asc).to_sql
    

    Marcelo Casiraghi, Robin Dupret

  • Dynamically register PostgreSQL enum OIDs. This prevents "unknown OID" warnings on enum columns.

    Dieter Komendera

  • includes is able to detect the right preloading strategy when string joins are involved.

    Fixes #14109.

    Aaron Patterson, Yves Senn

  • Fixed error with validation with enum fields for records where the value for any enum attribute is always evaluated as 0 during uniqueness validation.

    Fixes #14172.

    Vilius Luneckas Ahmed AbouElhamayed

  • before_add callbacks are fired before the record is saved on has_and_belongs_to_many assocations and on has_many :through associations. Before this change, before_add callbacks would be fired before the record was saved on has_and_belongs_to_many associations, but not on has_many :through associations.

    Fixes #14144.

  • Fixed STI classes not defining an attribute method if there is a conflicting private method defined on its ancestors.

    Fixes #11569.

    Godfrey Chan

  • Coerce strings when reading attributes. Fixes #10485.

    Example:

    book = Book.new(title: 12345)
    book.save!
    book.title # => "12345"
    

    Yves Senn

  • Deprecate half-baked support for PostgreSQL range values with excluding beginnings. We currently map PostgreSQL ranges to Ruby ranges. This conversion is not fully possible because the Ruby range does not support excluded beginnings.

    The current solution of incrementing the beginning is not correct and is now deprecated. For subtypes where we don't know how to increment (e.g. #succ is not defined) it will raise an ArgumentException for ranges with excluding beginnings.

    Yves Senn

  • Support for user created range types in PostgreSQL.

    Yves Senn

Please check 4-1-stable for previous changes.