rails/rails — pull request #13596 by timuralp (2014-01-05 09:16:10+00:00)
Title: Set transaction_open before begin_db_transaction.

As the transaction_open flag is used to rollback transactions and the
call to begin_db_transaction may itself raise an exception, the flag
must be set upfront. Otherwise, the transaction may be left open and
the database connection will no longer be usable as the transaction is
never rolled back.

Fixes: #13595