[ 
https://issues.apache.org/jira/browse/JCR-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462486
 ] 

Stefan Guggisberg commented on JCR-322:
---------------------------------------

> Sandro Boehme commented on JCR-322:
> -----------------------------------
> 
> People in the mailling list sometimes say that a deep lock is needed
> and that this is a big problem in this issue.
> I guess it is needed to avoid the new creation of nodes after
> the search for nodes with the node type that has to be unregistered.
> If that's the case maybe there is a way to avoid the deep lock.
> If a user tries to add a node with a node type that is currently
> being unregistered a NodeTypeNotFoundException (or similar) could
> already be thrown. This way it's possible to search for all nodes with
> this type and change the type to nt:base while the amount of nodes
> with this type will not change anymore.

unfortunately that wouldn't solve the issue at hand. 

first of all, there's no easy and elegant way of temporarily preventing node 
creation of a specific type (or a subtype thereof!). e.g. nodes of a specific 
type 
could have been already created transiently but not yet saved, such nodes 
could be in the transaction changelog, but not yet committed etc.

second, the purpose of the NodeTypeRegistry#checkForReferencesInContent() 
method is to reliably determine if there exists any instance of a specific type 
in content. if such exist the type can't be unregistered. just changing the 
type 
of such nodes doesn't work since child items depend on their defining node type
as well (-> Property#getDefiniton()#getDeclaringNodeType()).  just changing
the node type is guaranteed to affect repository data integrity.

see javadoc (i.e. the TODO comment) of 
NodeTypeRegistry#checkForReferencesInContent() 
for more details.

> To search for nodes by type the following query should work
> "//element(*, nt:nodeType)". Of course this needs to be done for
> every workspace.
> Do you think that could work?

> Support node type modification and removal
> ------------------------------------------
>
>                 Key: JCR-322
>                 URL: https://issues.apache.org/jira/browse/JCR-322
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: nodetype
>    Affects Versions: 0.9, 1.0
>            Reporter: Jukka Zitting
>
> There is currently no way to modify or remove registered node types. The 
> existing reregister and unregister methods in NodeTypeRegistry  throw "not 
> yet implemented" exceptions for anything else than trivial node type changes.
> JSR 283 is working on an node type management API that we should ultimately 
> implement.

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

        

Reply via email to