AnsweredAssumed Answered

Association Integrity

Question asked by rleones on Jul 27, 2011
Hello all,

I'd like to know how Alfresco treats integrity in (peer-)associations.

I'm getting an error in an particular case.

Here's my content model.
         <type name="mm:myContent">
            <title>My Content</title>
            <parent>cm:content</parent>   
            <associations>
               <association name="mm:contentsReferenced">
                  <source>
                    <mandatory>false</mandatory>
                    <many>true</many>
                  </source>
                  <target>
                    <class>mm:referencedContent</class>
                    <mandatory>false</mandatory>
                    <many>true</many>
                  </target>
               </association>
            </associations>
         </type>
      
      
         <type name="mm:referencedContent">
            <title>My Referenced Content</title>
            <parent>cm:content</parent>
            <properties>
               <property name="mm:prop1">
                  <title>Property One</title>
                  <type>d:text</type>
               </property>
               <property name="mm:prop2">
                  <title>Property Two</title>
                  <type>d:text</type>
               </property>
            </properties>
         </type>

I've tried to remove a content (mm:myReferencedContent) and the association was removed too, but when I removed the folder that holds the content referenced (mm:myReferencedContent) the association was not removed and when I've tried to update the main content (mm:myContent) I got an error about integrity.

The log I got in console:

15:47:35,785 ERROR [STDERR] AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
   {http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/a49de9ba-e4bd-48a5-9195-e846b43d53f5</ns1:message>
   {http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
   {http://xml.apache.org/axis/}stackTrace:
   at org.alfresco.repo.webservice.repository.RepositoryWebService.executeQuery(RepositoryWebService.java:170)
   at org.alfresco.repo.webservice.repository.RepositoryWebService.queryParents(RepositoryWebService.java:213)
   at sun.reflect.GeneratedMethodAccessor732.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   at java.lang.Thread.run(Thread.java:619)

   {http://xml.apache.org/axis/}hostname:gsi023

Does anyone knows why Alfresco is not removing the association when I removed the folder?

Outcomes