Skip to content

Commit 0d90338

Browse files
committed
minor: docs
1 parent 04033bf commit 0d90338

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The driver is thread-safe.
129129

130130
## Connection Pooling
131131

132-
As of v0.18, the driver implements connection pooling. By default, only one
132+
The driver implements connection pooling. By default, only one
133133
socket connection will be opened to MongoDB. However, if you're running a
134134
multi-threaded application, you can specify a maximum pool size and a maximum
135135
timeout for waiting for old connections to be released to the pool.
@@ -149,12 +149,24 @@ processes will create a new connection to the database. In Passenger, this can b
149149
if defined?(PhusionPassenger)
150150
PhusionPassenger.on_event(:starting_worker_process) do |forked|
151151
if forked
152-
# Create new connection here
152+
# Reset all connection objects. How you do this depends on where
153+
# you keep your connection object. In any case, call the #connect
154+
# method on the connection object. For example:
155+
# CONN.connect
156+
#
157+
# If you're using MongoMapper:
158+
# MongoMapper.connection.connect
153159
end
154160
end
155161
end
156162

157-
The above code should be put into a Rails initializer or other initialization script.
163+
In Unicorn, add this to your unicorn.rb file:
164+
165+
after_fork do |server, worker|
166+
# Handle reconnection
167+
end
168+
169+
The above code should be put into a Rails initializer or similar initialization script.
158170

159171
## String Encoding
160172

docs/FAQ.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,7 @@ Without further investigation, it's impossible to know exactly what has caused t
110110
Because of the indeterminacy involved, the MongoDB drivers will not retry operations on connection failure. How connection failures should be handled is entirely dependent on the application. Therefore, we leave it to the application developers to make the best decision in this case.
111111

112112
The drivers will reconnect on the subsequent operation.
113+
114+
#### I ocassionally get an error saying that responses are out of order. What's happening?
115+
116+
See (this JIRA issue)[http://jira.mongodb.org/browse/RUBY-221].

0 commit comments

Comments
 (0)