[
http://jira.jboss.com/jira/browse/JBCACHE-1078?page=all ]
Vincent Marquez updated JBCACHE-1078:
-------------------------------------
Attachment: TheadBugFix.patch.txt
This fixes the problem, simply moves the CachedFieldInterceptor attachment to after the
object has been put into the cache.
Race condition when adding an object to PojoCache while another
thread may read that object
-------------------------------------------------------------------------------------------
Key: JBCACHE-1078
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1078
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: PojoCache
Affects Versions: 2.0.0.BETA1, 2.0.0.BETA2, 2.0.0.CR1
Reporter: Vincent Marquez
Assigned To: Jason T. Greene
Attachments: TheadBugFix.patch.txt, ThreadTest.java
When adding an object to PojoCache, AdvisedPojoHandler attaches a CachedFieldInterceptor
to the advised object being added.(line 125) It does this before it adds the object to
the actual Cache. If another thread reads this object in between the time the
CachedFieldInterceptor is added and the object is inserted into the cache, (line 178) an
exception will be thrown in the Reading
thread:org.jboss.cache.pojo.PojoCacheAlreadyDetachedException: pojo: class
org.jboss.cache.pojo.test.Person has possibly been detached remotely.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira