Skip to content
Browse files

Non-thread-safe hack!! Use global variable to hold sessions to

prevent file descriptor leak with tomcat.
  • Loading branch information...
1 parent 8d07ee9 commit cec363b2bd74c1b6fed0ce4419a3cecc50e9ac94 Tim Olsen committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/mongoid/threaded.rb
View
6 lib/mongoid/threaded.rb
@@ -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

0 comments on commit cec363b

Please sign in to comment.
Something went wrong with that request. Please try again.