Index: DBPort.java =================================================================== --- DBPort.java (revision 1) +++ DBPort.java (working copy) @@ -23,6 +23,8 @@ import java.util.*; import java.util.logging.*; +import org.bson.BSONDecoder; + import com.mongodb.util.*; public class DBPort { @@ -93,7 +95,7 @@ return null; _processingResponse = true; - return new Response( coll , _in ); + return new Response( coll , _in , decoder); } catch ( IOException ioe ){ close(); @@ -246,6 +248,7 @@ final DBPortPool _pool; final MongoOptions _options; final Logger _logger; + private BSONDecoder decoder = new BSONDecoder(); private Socket _socket; private InputStream _in; Index: Response.java =================================================================== --- Response.java (revision 1) +++ Response.java (working copy) @@ -26,7 +26,7 @@ class Response { - Response( DBCollection collection , InputStream in ) + Response( DBCollection collection , InputStream in, BSONDecoder decoder) throws IOException { _collection = collection; @@ -53,8 +53,7 @@ else _objects = new ArrayList( _num ); - DBCallback c = DBCallback.FACTORY.create( _collection ); - BSONDecoder decoder = TL.get(); + DBCallback c = DBCallback.FACTORY.create( _collection ); for ( int i=0; i<_num; i++ ){ if ( user._toGo < 5 ) @@ -182,9 +181,9 @@ final List _objects; - static ThreadLocal TL = new ThreadLocal(){ - protected BSONDecoder initialValue(){ - return new BSONDecoder(); - } - }; +// static ThreadLocal TL = new ThreadLocal(){ +// protected BSONDecoder initialValue(){ +// return new BSONDecoder(); +// } +// }; }