ReadOnlyException when last lock taken was a read lock even though a write lock 
is held
---------------------------------------------------------------------------------------

                 Key: CDV-775
                 URL: https://jira.terracotta.org/jira//browse/CDV-775
             Project: Community Development
          Issue Type: Bug
          Components: Lock Manager
            Reporter: Stuart Scott
            Assignee: Issue Review Board
         Attachments: ThrowReadOnlyException.java

If the write lock of a ReentrantReadWriteLock is held then the read lock taken 
and a shared object modified a ReadOnlyException will be thrown even though the 
write lock is held (see attached example ThrowReadOnlyException.java).

This is also the case if the write lock and read locks of different 
ReentrantReadWriteLocks are held (see forum post 
http://forums.terracotta.org/forums/posts/list/1124.page#6770).

It appears that when checking if a shared object is writable only the very last 
lock taken counts.

The simple work around is to make sure the write lock is the last lock taken 
before modifying the shared object.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to