[JAVA-579] when i query data,i have got a expetion:SocketException handling request, closing client connection: 9001 socket exception [2] server in logfile Created: 31/May/12 Updated: 11/Sep/19 Resolved: 04/Jun/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | ben.s | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | driver, query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
linux,64bit. |
||
| Attachments: |
|
| Description |
|
==============================background================================== the java code to operator mongodb to query data like this:
================================ERROR======================================= nscanned:53832616 reslen:20 11032064ms nscanned:53832616 reslen:20 11014949ms nscanned:53832616 reslen:20 11028041ms nscanned:53832616 reslen:20 11029619ms nscanned:53832616 reslen:20 11045234ms nscanned:53832616 reslen:20 11049350ms nscanned:53832616 reslen:20 11044775ms nscanned:53832616 reslen:20 11037628ms nscanned:53832616 reslen:20 11059201ms nscanned:53832616 reslen:20 11067425ms i wonder is options.socketKeepAlive = true; trigger the error.because when use this config,the error is start to appear.but i'm not sure. |
| Comments |
| Comment by ben.s [ 04/Jun/12 ] |
|
i test DBCursor.close(),but it's not working.when i change the data in collection,one query return one data,only 8 bit,it's work very well. |
| Comment by Jeffrey Yemin [ 04/Jun/12 ] |
|
Make sure you call DBCursor.close() |
| Comment by ben.s [ 04/Jun/12 ] |
|
thanks jeff. |
| Comment by ben.s [ 04/Jun/12 ] |
|
it's just test code,there's no more code.mybe i found why the connection can't close.i test one query,it return mass data,and spend a lot of time into it.when mongodb want to close a connection cause there is too many connection on the server but the connection is busy,so it's failed. |
| Comment by Jeffrey Yemin [ 04/Jun/12 ] |
|
There must be more code, right? None of the code you included initiates a connection to the server (DBCollection.find(..) doesn't actually send the query. Nothing happens until you start iterating the cursor). Looking at the server logs, the queries seems to be happening, so I'm assuming there must be more code that's not being shown here. For future reference, this kind of question is better handled on the mongodb-users list. |