You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by "Daniel Spicar (JIRA)" <ji...@apache.org> on 2011/02/22 14:07:39 UTC

[jira] Updated: (CLEREZZA-431) RDFList should not write in its constructor

     [ https://issues.apache.org/jira/browse/CLEREZZA-431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Spicar updated CLEREZZA-431:
-----------------------------------

    Attachment: clerezza-431-patch.diff

Added a patch with the proposed solution.

> RDFList should not write in its constructor
> -------------------------------------------
>
>                 Key: CLEREZZA-431
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-431
>             Project: Clerezza
>          Issue Type: Improvement
>            Reporter: Daniel Spicar
>              Labels: list, rdfList
>         Attachments: clerezza-431-patch.diff
>
>
> The implementation of RdfList in the rdf.utils project performs a write when creating an empty RdfList.
> This is dangerous because when the underlying graph is a LockableMGraphWrapper it tries to get a write lock on the graph before adding. If the creation of the list happens inside a read lock on the same graph this will create a deadlock. It requires a lot of knowledge of the implementation to be aware of these side-effects.
> It may be better for users of RdflList if no such unexpected locks are set. The write access happens, because for an empty list, the triple "listResource owl:sameAs rdf:Nil" is added to the underlying graph. This is correct but not necessary. The suggestion is that the presence of an rdf:first property is used to determine whether the list is empty or not. We can provide a static method for the user to create an empty list with the owl:sameAs rdf:Nil triple if a user desires to do so and is aware of the side effects. In the add and remove methods the owl:sameAs rdf:Nil triple can still be removed/added as these operations clearly require write access.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira