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

Jason T. Greene (JIRA) jira-events at lists.jboss.org
Thu May 31 22:11:18 EDT 2007


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

Jason T. Greene resolved JBCACHE-1078.
--------------------------------------

    Fix Version/s: 2.0.0.CR3
                       (was: 2.0.0.CR4)
       Resolution: Done

Thanks for the patch, I will go ahead and apply this.  Keep in mind though, that this will only fix the pessimistic locking scenario. 

I will create a separate issue to revisit interceptor behavior during attachment.

Thanks again!

> 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: Patch
>      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
>             Fix For: 2.0.0.CR3, 2.0.0.GA
>
>         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

        



More information about the jboss-jira mailing list