Skip to content

Commit b8b6e5b

Browse files
committed
fix pooling with write concern
1 parent 7fdb36d commit b8b6e5b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/com/mongodb/DBTCPConnector.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ public void requestEnsureConnection(){
110110
_threadPort.get().requestEnsureConnection();
111111
}
112112

113-
void _checkWriteError()
113+
void _checkWriteError( MyPort mp , DBPort port )
114114
throws MongoException {
115115

116116
DBObject e = _mongo.getDB( "admin" ).getLastError();
117+
mp.done( port );
118+
117119
Object foo = e.get( "err" );
118120
if ( foo == null )
119121
return;
@@ -138,9 +140,11 @@ public void say( DB db , OutMessage m , DB.WriteConcern concern )
138140
try {
139141
port.say( m );
140142
if ( concern == DB.WriteConcern.STRICT ){
141-
_checkWriteError();
143+
_checkWriteError( mp , port );
144+
}
145+
else {
146+
mp.done( port );
142147
}
143-
mp.done( port );
144148
}
145149
catch ( IOException ioe ){
146150
mp.error( ioe );

0 commit comments

Comments
 (0)