datamapper/dm-core — Issue #188: ConcurrencyError in logging using JRuby
Author: carlossg
Created: 2012-02-24 12:14:29+00:00
State: open

Using jruby-1.6.5 with log enabled, and dm-core-1.1.0 (1.2.0 has the same logger.rb file) I get continuous stack traces in the console

``` ruby
DataMapper::Logger.new("log/datamapper.log", :debug)
```

Trace:

```
ConcurrencyError - Detected invalid array contents due to unsynchronized modifications with concurrent users:
org/jruby/RubyArray.java:1153:in `<<'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-core-1.1.0/lib/dm-core/support/logger.rb:150:in `<<'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-core-1.1.0/lib/dm-core/support/logger.rb:204:in `error'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:278:in `with_connection'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:141:in `read'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-core-1.1.0/lib/dm-core/repository.rb:162:in `read'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-core-1.1.0/lib/dm-core/collection.rb:1117:in `lazy_load'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-core-1.1.0/lib/dm-core/support/lazy_array.rb:409:in `each'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-core-1.1.0/lib/dm-core/collection.rb:504:in `each'
org/jruby/RubyEnumerable.java:705:in `collect'
/Users/csanchez/.rvm/gems/jruby-1.6.5/gems/dm-serializer-1.1.0/lib/dm-serializer/to_json.rb:85:in `to_json'
```