diff options
author | wangjohn <wangjohn@mit.edu> | 2013-01-24 23:42:39 -0500 |
---|---|---|
committer | wangjohn <wangjohn@mit.edu> | 2013-02-20 10:51:28 -0500 |
commit | 67d8bb963d5d51fc644d6b1ca20164efb4cee6d7 (patch) | |
tree | 7bfa8c62f8032c35de714dcde95ed3d7bef57728 /activerecord/CHANGELOG.md | |
parent | 3a0b6c8e135e268c1550f93db1b63ba27457dec2 (diff) | |
download | rails-67d8bb963d5d51fc644d6b1ca20164efb4cee6d7.tar.gz rails-67d8bb963d5d51fc644d6b1ca20164efb4cee6d7.tar.bz2 rails-67d8bb963d5d51fc644d6b1ca20164efb4cee6d7.zip |
Reduced memory leak problem in transactions by lazily updating AR objects with new transaction state. If AR object has a callback, the callback will be performed immediately (non-lazily) so the transaction still has to keep records with callbacks.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index a888b79391..e864e90e6f 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,27 @@ ## Rails 4.0.0 (unreleased) ## +* Fixing issue #776. + + Memory bloat in transactions is handled by having the transaction hold only + the AR objects which it absolutely needs to know about. These are the AR + objects with callbacks (they need to be updated as soon as something in the + transaction occurs). + + All other AR objects can be updated lazily by keeping a reference to a + TransactionState object. If an AR object gets inside a transaction, then + the transaction will add its TransactionState to the AR object. When the + user makes a call to some attribute on an AR object (which has no + callbacks) associated with a transaction, the AR object will call the + sync_with_transaction_state method and make sure it is up to date with the + transaction. After it has synced with the transaction state, the AR object + will return the attribute that was requested. + + Most of the logic in the changes are used to handle multiple transactions, + in which case the AR object has to recursively follow parent pointers of + TransactionState objects. + + *John Wang* + * Descriptive error message when the necessary AR adapter gem was not found. Fix #7313 |