3 Replies Latest reply on Jun 15, 2011 9:00 AM by imran_issufo

    Error: Destinations with associations must have the same data store

    imran_issufo

      Hello guys,

       

      im using  LCDS 3.1 and Flash Builder 4.5 with Model Driven Development Plugin 

       

      im getting this error every first time i call my view(mxml), but the second time and so on this does happen

       

      I have a  relationship between Treinamento(Course) with GrupoTreinamento(Group)

      Treinamento MANY-TO-ONE GrupoTreinamento

       

      This only happens when i do unidirectional relationship and i get this error:

       

       

      Error: Destinations with associations must have the same data store: sct.Treinamento has dataStore: my-rtmp:true and sct.GrupoTreinamento has: null

      at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::checkAssociatedDataStores()[C:\depot\DataServi ces\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\ConcreteDataServic e.as:561]

      at mx.data::ConcreteDataService/setupNewDataStore()[C:\depot\DataServices\branches\milestone \lcds45_fb45\frameworks\projects\data\src\mx\data\ConcreteDataService.as:3266]

      at mx.data::ConcreteDataService/get dataStore()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data \src\mx\data\ConcreteDataService.as:539]

      at mx.data::ConcreteDataService/set autoCommit()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\dat a\src\mx\data\ConcreteDataService.as:192]

      at mx.data::DataManager/set autoCommit()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\dat a\src\mx\data\DataManager.as:325]

      at sct.forms::_SuperTreinamentoForm/creationCompleteHandler()[C:\wlcds45\sct\src\sct\forms\_ SuperTreinamentoForm.mxml:309]

      at sct.forms::_SuperTreinamentoForm/____SuperTreinamentoForm_Form1_creationComplete()[C:\wlc ds45\sct\src\sct\forms\_SuperTreinamentoForm.mxml:2]

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at mx.core::UIComponent/dispatchEvent()[E:\dev\hero_private\frameworks\projects\framework\sr c\mx\core\UIComponent.as:13128]

      at mx.core::UIComponent/set initialized()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\UIComponent.a s:1818]

      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private\frameworks\project s\framework\src\mx\managers\LayoutManager.as:842]

      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\hero_private\frameworks \projects\framework\src\mx\managers\LayoutManager.as:1180]

      When i do birectional relationship this doesnt happen
      Treinamento MANY-TO-ONE GrupoTreinamento
      GrupoTreinamento ONE-TO-MANY Treinamento
      Can anybody help me
      Regards,
      Imraan

        • 1. Re: Error: Destinations with associations must have the same data store
          Rohit . Kumar Adobe Employee

          Assuming you have not explictly assigned a different data store for the  Course and Group (they need to be the same for both these destinations),can you check that, both the Course and Group destinations are using:

          1. Same channel set/set of channels, and
          2. Same settings for use-transaction property on the DMS destination.

           

          Rohit

          • 2. Re: Error: Destinations with associations must have the same data store
            imran_issufo Level 1

            Thanks 4 reply

             

            This my COURSE ENTITY

             

            <entity name="Treinamento" persistent="true">

            <annotation name="ServerProperties" ServerType="LCDS"/>

            <annotation name="VisualModeler" width="115" height="206" x="588" y="616"/>

            <annotation name="ActionScriptGeneration" DisplayColumn="codigo"/>

            <annotation name="service Group" service="PlaneamentoService,TreinamentoService"/>

            <annotation name="FbEntityProperties" contextRoot="/lcds"/>

            <id name="ID" type="integer"/>

            <property name="codigo" type="string"/>

            <property name="nome" type="string"/>

            <property name="descricao" type="string" length="1500"/>

            <property name="duracao" type="string"/>

            <property name="validade" type="integer"/>

            <property name="planeamentos" type="Planeamento[]" mappedBy="treinamento"/>

            <property name="grupoTreinamento" type="GrupoTreinamento" cardinality="many-to-one"/>

            <property name="removido" type="boolean"/>

            <filter name="buscarTodos" criteria="removido eq">

            <annotation name="DMS" propertySpecifier="ID, codigo, nome, descricao, duracao, validade, removido"/>

            </filter>

            <filter name="buscarPeloGrupo" criteria="grupoTreinamento eq, removido eq" order="codigo">

            <annotation name="DMS" propertySpecifier="ID, codigo, nome, descricao, duracao, validade, removido"/>

            </filter>

            </entity>

             

            AND THIS IS MY GROUP ENTITY

             

            <entity name="GrupoTreinamento" persistent="true">

            <annotation name="ServerProperties" ServerType="LCDS"/>

            <annotation name="VisualModeler" width="144" height="142" x="1227" y="627"/>

            <annotation name="service Group" service="PlaneamentoService,TreinamentoService,GrupoTreinamentoService"/>

            <annotation name="FbEntityProperties" contextRoot="/lcds"/>

            <annotation name="ActionScriptGeneration" DisplayColumn="nome"/>

            <id name="ID" type="integer"/>

            <property name="nome" type="string"/>

            <property name="descricao" type="string"/>

            <property name="planeamentos" type="Planeamento[]" mappedBy="grupoTreinamento"/>

            <property name="treinamentos" type="Treinamento[]" mappedBy="grupoTreinamento"/>

            <property name="removido" type="boolean"/>

            <filter name="buscarTodos" criteria="removido eq" order="nome">

            <annotation name="DMS" propertySpecifier="nome, descricao, removido"/>

            </filter>

            </entity>

             

             

            Imraan

            • 3. Re: Error: Destinations with associations must have the same data store
              imran_issufo Level 1

              Hello Rohit,

               

              im using flash builder 4.5 and am adding -services parameter to point to services-config.xml while compiling

              -services "c:\lcds\tomcat\webapps\lcds\WEB-INF\flex\services-config.xml"

               

              so both are using same channels and same transaction option.

               

              I get tha error every first time i call the services.

              After that, it works fine.

               

              Its seem to me some kind of lazy initialization os the services.

               

              This happens only when i have a UNIDIRECTIONAL relatioship

               

              If i do BIDIRECTIONAL i got no error. it works fine. And dont whant BIDIRECTIONAL, because he caches the collections, even when its lazy load (just id), and my collection its big.

               

               

              regards,

              Imraan