Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

MySQL reconnect value doesn't stick

#1797

The MySQL reconnect value which was added in commit 9051da90e4da2ab0db16530a7f7568e24a0ccaed doesn't stick, because the mysql gem sets it to false inside real_connect().

The attached patch fixes this problem, and also allows the user to set the value of the reconnect attribute by adding

reconnect: true

to database.yml (again, this is relevant to mysql only).

The default of this attribute is false in order not to change the behaviour of existing applications.

See discussion in http://groups.google.com/group/r...

Related to #1293 MySQL adapter doesn't reconnect on lost connection

Note that I ran the tests of this patch on Mac OS X 10.5.6 and MySQL 5.0.67 .

Reported by Dov Murik · January 26th, 2009 @ 03:07 PM

State: committed
Milestone: 2.x
Assigned to: Michael Koziarski Michael Koziarski
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to committed

    (from [e5c211c5eb6e8f1651130b7aa0a5291e5d184ab4]) Mysql#reconnect is set according to the 'reconnect' key in the connection spec.

    The 'reconenct' boolean option is read from the connection specification and is used to set the reconnect attribute of Mysql. The default is false in order not to change existing application behaviour.

    Also, reconnect is set AFTER real_connect is called, so its value sticks (the mysql gem sets reconnect to false inside real_connect).

    Signed-off-by: Michael Koziarski michael@koziarski.com [#1797 MySQL reconnect value doesn't stick state:committed] http://github.com/rails/rails/co...

    January 26th, 2009 @ 08:57 PM

  2. Repository
    Repository

    (from [5fe6635e05a18b312c47fe6bbbaf88fd62e7703d]) Mysql#reconnect is set according to the 'reconnect' key in the connection spec.

    The 'reconenct' boolean option is read from the connection specification and is used to set the reconnect attribute of Mysql. The default is false in order not to change existing application behaviour.

    Also, reconnect is set AFTER real_connect is called, so its value sticks (the mysql gem sets reconnect to false inside real_connect).

    Signed-off-by: Michael Koziarski michael@koziarski.com [#1797 MySQL reconnect value doesn't stick state:committed] http://github.com/rails/rails/co...

    January 26th, 2009 @ 08:57 PM