dev.morphia.Datastore Thread Safety #2802
Replies: 6 comments
-
|
I am creating data source like below |
Beta Was this translation helpful? Give feedback.
-
|
What version are you on? 2.4.10 should have all that cleaned up but it should be noted that |
Beta Was this translation helpful? Give feedback.
-
|
I am using morphia-core - 2.4.5 & mongodb-driver-sync - 4.10.2. I want to use Morphia datastore in my web application (many concurrent user/request to pull/save data) and creating new data store for each request might waste a lot of resource. Could you please advise best way to do that. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
|
@evanchooly Could you please advise, if I am using Morphia in a wrong way. Any kind of help, I will highly apricate. I need to make some decision. Again, many thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
|
The mapping process is the sticking point and I've been working on making it thread safer. You're hitting a corner case that isn't necessarily destructive and a later version has ensmartened that check to avoid false positive warnings. So I would suggest bumping to 2.4.10 (and I'm about push 2.4.11 to fix a query document shape bug) to clear up those warnings. |
Beta Was this translation helpful? Give feedback.
-
|
I tested with version 2.4.11 and issue is still there. If I run the same test multiple time, issue appears. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When dev.morphia.Datastore shared across thread, I get Two entities have been mapped using the same discriminator value.
To Reproduce
Steps to reproduce the behavior:
I get Two entities have been mapped using the same discriminator value.
Try two scenario
Beta Was this translation helpful? Give feedback.
All reactions