Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

JAVA-787: Calling OutMessage.doneWithMessage in finally block of DBPo…

…rt.findOne
  • Loading branch information...
commit 81b21a435c45eed4ed11ed94114454e7be89827d 1 parent 8453201
@jyemin jyemin authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/main/com/mongodb/DBPort.java
View
8 src/main/com/mongodb/DBPort.java
@@ -158,8 +158,12 @@ synchronized CommandResult getLastError( DB db , WriteConcern concern ) throws I
synchronized private Response findOne( DB db , String coll , DBObject q ) throws IOException {
OutMessage msg = OutMessage.query( db.getCollection(coll) , 0 , 0 , -1 , q , null );
- Response res = go( msg , db.getCollection( coll ) , null );
- return res;
+ try {
+ Response res = go( msg , db.getCollection( coll ) , null );
+ return res;
+ } finally {
+ msg.doneWithMessage();
+ }
}
synchronized CommandResult runCommand( DB db , DBObject cmd ) throws IOException {
Please sign in to comment.
Something went wrong with that request. Please try again.