Issue Type: Bug Bug
Affects Versions: JRuby 1.6.7
Assignee: Thomas E Enebo
Created: 11/Sep/12 5:14 PM
Description:

Enumerators executed by calling next have a new thread with a new object_id.

This causes odd bugs with ActiveRecord in Rails since it gives you a connection based on Thread.current.object_id. This can leave unclosed database connections hanging around because there is no guarantee that the enumerator will finish.

In MRI, the thread doesn't change, so you have the same connection object inside the Enumerator as you do outside.

puts Thread.current.object_id
puts Enumerator.new {|y| y << Thread.current.object_id}.next

Under MRI, both lines return the same value, in JRuby 1.6.7 they are different.

Environment: OSX
Project: JRuby
Priority: Major Major
Reporter: Joseph Palermo
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to