jruby/activerecord-jdbc-adapter — pull request #557 by mjc (2014-06-02 01:48:37+00:00)
Title: MSSQL: Throwing exceptions in the hot path results in slow code

On MSSQL, the following code gets 2800 inserts to the CSV per second on MRI,
and 300/s (indy off) on 1.7.12.
```
class Widget < ActiveRecord::Base
end

CSV.open('test.csv','wb') do |csv|
Widget.find_each do |w|
csv << w.attributes.values
end
end
```
I ran it through the JRuby profiler.
79%self was being spent in ArJdbc::MSSQL ArJdbc::MSSQL::Column.type_cast.

Since generating backtraces etc for exceptions are very slow on JRuby,
I guessed at the kind of exceptions this code would encounter.
I'm almost certain there are things I am missing, but this code now performs identically
on MRI and JRuby 1.7.12 (indy off.)

If there is anything else I need to do to make this suitable for merging, I'm happy to do it.