[JAVA-2794] Spring MongoTemplate through exception while accessing through spring @async(multithreading) method Created: 27/Feb/18 Updated: 27/Oct/23 Resolved: 27/Feb/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Async, Connection Management |
| Affects Version/s: | 3.5.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Swapnadarsan moharana | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 64 bit. |
||
| Issue Links: |
|
||||||||
| Description |
|
Hi, Got this error while trying to aggregate through spring data mongoDB in a Spring async method.
|
| Comments |
| Comment by Ross Lawley [ 27/Feb/18 ] | ||||||||||||||||||||||||||||
|
Hi darsan55, I think that this is something you should either post on Stackoverflow or reach out to the Spring Team as how to achieve what you are after. The cause of the error is as described above and I'd hazzard a guess one thread has closed the client. Ross | ||||||||||||||||||||||||||||
| Comment by Swapnadarsan moharana [ 27/Feb/18 ] | ||||||||||||||||||||||||||||
|
Hi Roos, #1below is the spring function from where i m doing aggregation.
The above method i m calling from a async method from inside a loop. so every call will be a separate thread. | ||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 27/Feb/18 ] | ||||||||||||||||||||||||||||
|
Hi darsan55, That error occurs when the Cluster is used after it has been closed. This is often indicitive of closing the MongoClient in one thread, while still using it in another. At the moment I'm inclined to close this as "Works As Designed" but will wait for more feedback to confirm the cause of the error. It could be possible its a Spring issue, however, we haven't heard any similar reports. Please provide more information and if possible a test case reproducing the error and I'll follow up. Ross |