title: Mongo+Java+SocketTimeOut
body: <p>I am using MongoDb and I am facing problems while reading the records from the DB.
  I am able to get them in the cursor but when I try to get the records from the cursor using
  cursor.hasNext() it gives me following exception:</p>
  
  <pre><code>com.mongodb.MongoInternalException: couldn't get next element
          at com.mongodb.DBCursor.hasNext(DBCursor.java:459)
  Caused by: java.net.SocketTimeoutException: Read timed out
          at java.net.SocketInputStream.socketRead0(Native Method)
          at java.net.SocketInputStream.read(SocketInputStream.java:146)
          at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
          at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
          at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
          at org.bson.io.Bits.readFully(Bits.java:35)
          at org.bson.io.Bits.readFully(Bits.java:28)
          at com.mongodb.Response.&lt;init&gt;(Response.java:35)
          at com.mongodb.DBPort.go(DBPort.java:101)
          at com.mongodb.DBPort.go(DBPort.java:66)
          at com.mongodb.DBPort.call(DBPort.java:56)
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:211)
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:220)
          at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:220)
          at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:266)
          at com.mongodb.DBCursor._check(DBCursor.java:309)
          at com.mongodb.DBCursor._hasNext(DBCursor.java:431)
          at com.mongodb.DBCursor.hasNext(DBCursor.java:456)
  </code></pre>
  
  <p>Maybe I am facing this issue as my data is continously increasing so I am getting more number of records in the cursor. Also the database I am accessing is on remote machine.</p>
  
  <p>Please need help on this.</p>
  
  <p>Thanks!</p>