[CDO] Object is unexpectedly non-writable [message #1796263] |
Tue, 09 October 2018 07:42  |
Eclipse User |
|
|
|
We are using an older CDO version: 4.5.0
In rare cases, we have a problem with write access to a resource.
This is basically what we do:
* A CDOTransaction adds/removes elements from a list (e.g. contents of a CDOResource)
* A CDOView (other session) monitors this list (in our case, the list is the input for an SWT Jface TableViewer)
Now, sometimes elements cannot be removed because they are not writable.
I.e.: element.cdoPermission().isWritable() == false
A write lock can be obtained without any problem, but the isWritable flag is still false:
I.e.: element.cdoWriteLock().lock()
=> The problem only applies to the session with the transaction. All other sessions see the element as writable.
=> Closing and reopening the transaction does not help.
=> We observed that the element may be writable again after a longer period of time (sometimes minutes, sometimes not for 1 hour).
=> If no view monitors the list, the problem does not happen.
Does anybody know what could be going on? Could a new CDO version potentially fix this problem? Unfortunately, we are not able to migrate to a newer version right away, but it would be an option for the future.
[Updated on: Tue, 09 October 2018 08:12] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: [CDO] Object is unexpectedly non-writable [message #1800867 is a reply to message #1800856] |
Wed, 09 January 2019 04:34  |
Eclipse User |
|
|
|
Eike Stepper wrote on Wed, 09 January 2019 08:01
What kind of list is that?
It is simply a containment reference list. I attached the very short ecore that we use. In that case it is the Log=>Entries field.
Eike Stepper wrote on Wed, 09 January 2019 08:01
A separate session (without committing through it) is not enough to clear the situation?
The separate session immediately sees the correct state. But in order to recover the original session, we need to commit some change to the object.
Another approach which worked for me but is probably unsafe:
EList<SomeClass> theList = getList();
theList.add(someObject);
theList.remove(4);
transaction.commit();
if(!someObject.cdoPermission().isWritable()) {
((BaseCDORevision) someObject.cdoRevision()).setPermission(CDOPermission.WRITE);
}
|
|
|
Powered by
FUDForum. Page generated in 0.21703 seconds