I did a quick test last night and was able to get the specs to pass on all version of Ruby we target. I used the old `[]` and `[]=` syntax on pre-2.0 versions (code below. I *think* it accomplishes the same thing on those versions, but there may be a better implementation.

I definitely like `ThreadLocalVariable`. I've been talking to @lucasallan and @headius about JRuby-specific optimizations. So long as the gem behaves consistently across MRI, JRuby, and Rubinius I will absolutely support interpreter-specific optimizations. I think that's better for the community. Simple abstractions like `ThreadLocalVariable` support that type of optimization, as well as providing a potentially useful abstractions in their own right.

Here is the code I tested last night:

```ruby
if Thread.current.respond_to?(:thread_variable_set)
  Thread.current.thread_variable_set(:transaction, transaction)
else
  Thread.current[:transaction] = transaction
end

if Thread.current.respond_to?(:thread_variable_get)
  Thread.current.thread_variable_get(:transaction)
else
  Thread.current[:transaction]
end
```