Skip to content

Commit

Permalink
Non-thread-safe hack!! Use global variable to hold sessions to
Browse files Browse the repository at this point in the history
prevent file descriptor leak with tomcat.
  • Loading branch information
Tim Olsen committed Oct 19, 2012
1 parent 8d07ee9 commit cec363b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/mongoid/threaded.rb
Expand Up @@ -57,7 +57,11 @@ def database_override=(name)
#
# @since 3.0.0
def sessions
Thread.current["[mongoid]:sessions"] ||= {}
#Thread.current["[mongoid]:sessions"] ||= {}

# Non-threadsafe Hack! Use global sessions
# to prevent file descriptor leak with tomcat
$mongoid_sessions ||= {}
end

# Are in the middle of executing the named stack
Expand Down

0 comments on commit cec363b

Please sign in to comment.