[50-52, core] Fix exception handling within transaction
[50-52, core] Fix exception handling within transaction

When inside a transaction, never retry any statements. Retrying
transient errors is wrong as the transaction is typically already
rolled back. Retrying then only re-does the last statement, possibly
in a series of multiple statements, leading to unnoticed data loss.

The MySQL driver for example throws a MySQLTransactionRollbackException
when a deadlock is found. This inherits from MySQLTransientException
which inherits from SQLTransientException. The transaction is already
rolled back when the last statement was retried.

Fixes:
* rails/test/cases/adapters/mysql2/transaction_test.rb

bruceadams/activerecord-jdbc-adapter,kares/activerecord-jdbc-adapter,jruby/activerecord-jdbc-adapter,jruby/activerecord-jdbc-adapter,kares/activerecord-jdbc-adapter,kares/activerecord-jdbc-adapter,jruby/activerecord-jdbc-adapter,bruceadams/activerecord-jdbc-adapter,bruceadams/activerecord-jdbc-adapter