Concurrency Bug: unsynchronized WeakHashMap in OIDFactory
Project: DataNucleus Core
Issue Type: Bug
Reporter: Fernando Padilla
Our systems keep hanging, and we have lots of threads stuck on this stack trace:
I did a yahoo search and found the mention below, that states that they ran into it while using WeakHashMap while not properly synchronized. And this is the case here.
So we simply need to add synchronization around the WeakHashMap access.
ps - I actually wonder, if using a WeakHashMap to cache OIDs is actually beneficial. Just a hypothesis, that we could/should test. With the latest GCs it's sometimes better to simply create short lived objects, rather than try managing pools. Also, I noticed that to generate the Key for the cache, pretty much does the same work (concat class/oid) as what the constructor for OIDImpl (and OIDImplKodo that we use) does. So it doesn't seem to save any work what so ever. Just add another single point of synchronization and bottleneck... I propose to simply get rid of the caching. :)
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://www.datanucleus.org/servlet/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira