[jboss-jira] [JBoss JIRA] Updated: (JBCACHE-1078) Race condition when adding an object to PojoCache while another thread may read that object

Vincent Marquez (JIRA) jira-events at lists.jboss.org
Tue May 29 23:43:08 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBCACHE-1078?page=all ]

Vincent Marquez updated JBCACHE-1078:
-------------------------------------

    Attachment: ThreadTest.java

This is a test case I wrote using Junit to show the bug.  It needs a breakpoint to show the threading problem.  

> 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: 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

        



More information about the jboss-jira mailing list