3 Replies Latest reply on Jul 11, 2011 10:05 AM by imran_issufo

    Same data store

    imran_issufo Level 1

      Hello guys,

       

       

      im using flash builder4.5 with flex 4.5 lcds 3.1 and model driven plugin.

       

      i need help to solve this problem:

       

      Error: Destinations with associations must have the same data store: sct.Planeamento 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 mz.vale.sct.modelo.forms::_SuperPlaneamentoForm/creationCompleteHandler()[C:\wlcds45\sct\ src\mz\vale\sct\modelo\forms\_SuperPlaneamentoForm.mxml:367]

      at mz.vale.sct.modelo.forms::_SuperPlaneamentoForm/____SuperPlaneamentoForm_Form1_creationCo mplete()[C:\wlcds45\sct\src\mz\vale\sct\modelo\forms\_SuperPlaneamentoForm.mxml:6]

      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]

       

       

      how do i set 'same data store'  ??? im using model driven development plugin.

       

       

       

      regards,

      imraan

       

        • 1. Re: Same data store
          Mike Peterson

          Would have to see your model or project to see why you do not have the same DataStore instance for these two entities. When there is a an association between entities, the same DataStore should be be used automatically for the two entities as long as the value of use-transactions is the same for both and they use the same set of channels.

          • 2. Re: Same data store
            imran_issufo Level 1

            Hi Mike,

             

            here the model :

             

             

            <model xmlns="http://ns.adobe.com/Fiber/1.0">

            <annotation name="DMS">

            <item name="datasource">java:comp/env/sct</item>

            <item name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</item>

            <item name="LikeOperatorCaseSensitive">false</item>

            </annotation>

            <annotation name="ActionScriptGeneration">

            <item name="FullyQualifyReferences">true</item>

            </annotation>

            <annotation name="VisualModeler">

            <item name="rdsServerName">LCDS (localhost)</item>

            </annotation>

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

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

            <annotation name="VisualModeler" width="357" height="638" x="609" y="-13"/>

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

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

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

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

            <property name="dataPlaneamento" type="date"/>

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

            <property name="dataReprogramado" type="date"/>

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

            <property name="dataRealizado" type="date"/>

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

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

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

            <property name="ocupante" type="Ocupante" cardinality="many-to-one">

            <annotation name="DMS" lazy="false"/>

            </property>

            <property name="grupoTreinamento" type="GrupoTreinamento">

            <annotation name="DMS" lazy="false"/>

            </property>

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

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

            <property name="funcionario" type="Funcionario">

            <annotation name="DMS" lazy="false"/>

            </property>

            <property name="treinamento" type="Treinamento">

            <annotation name="DMS" lazy="false"/>

            </property>

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

            <filter name="filtrarPelaDataPlaneamento" criteria="dataPlaneamento gte, dataPlaneamento lt, removido eq" order="dataPlaneamento"/>

            <filter name="filtrarPelaDataStatusPlaneamento" criteria="statusPlaneamento like, dataPlaneamento gte, dataPlaneamento lt, removido eq" order="dataPlaneamento"/>

            <filter name="filtrarPeloGrupoTreinamentoDataPlaneamento" criteria="grupoTreinamento eq, treinamento eq, dataPlaneamento gte, dataPlaneamento lt, removido eq" order="dataPlaneamento"/>

            <filter name="filtrarPeloGrupoTreinamentoDataStatusPlaneamento" criteria="statusPlaneamento like, grupoTreinamento eq, treinamento eq, dataPlaneamento gte, dataPlaneamento lt, removido eq" order="dataPlaneamento"/>

            <filter name="filtrarPeloGrupoDataPlaneamento" criteria="grupoTreinamento eq, dataPlaneamento gte, dataPlaneamento lt, removido eq" order="dataPlaneamento"/>

            <filter name="filtrarPeloGrupoDataStatusPlaneamento" criteria="statusPlaneamento like, grupoTreinamento eq, dataPlaneamento gte, dataPlaneamento lt, removido eq" order="dataPlaneamento"/>

            <filter name="filtrarPelaDataRealizado" criteria="dataRealizado gte, dataRealizado lt, removido eq" order="dataRealizado"/>

            <filter name="filtrarPeloGrupoTreinamentoDataRealizado" criteria="grupoTreinamento eq, treinamento eq, dataRealizado gte, dataRealizado lt, removido eq" order="dataRealizado"/>

            <filter name="filtrarPeloGrupoDataRealizado" criteria="grupoTreinamento eq, dataRealizado gte, dataRealizado lt, removido eq" order="dataRealizado"/>

            <filter name="filtrarPelaDataReprogramado" criteria="dataReprogramado gte, dataReprogramado lt, removido eq" order="dataReprogramado"/>

            <filter name="filtrarPeloGrupoTreinamentoDataReprogramado" criteria="grupoTreinamento eq, treinamento eq, dataReprogramado gte, dataReprogramado lt, removido eq" order="dataReprogramado"/>

            <filter name="filtrarPeloGrupoDataReprogramado" criteria="grupoTreinamento eq, dataReprogramado gte, dataReprogramado lt, removido eq" order="dataReprogramado"/>

            <filter name="filtrarPorTreinamentoDataPlaneamento" criteria="treinamento eq, dataPlaneamento gte, dataPlaneamento lt, removido eq">

            <annotation name="DMS" propertySpecifier="ID"/>

            </filter>

            <filter name="filtrarPorTreinamentoDataReprogramado" criteria="treinamento eq, dataReprogramado gte, dataReprogramado lt, removido eq">

            <annotation name="DMS" propertySpecifier="ID"/>

            </filter>

            <filter name="filtrarPorTreinamentoDataRealizado" criteria="treinamento eq, dataRealizado gte, dataRealizado lt, removido eq">

            <annotation name="DMS" propertySpecifier="ID"/>

            </filter>

            <filter name="filtrarPorGrupoDataPlaneamento" criteria="grupoTreinamento eq, dataPlaneamento gte, dataPlaneamento lt, removido eq">

            <annotation name="DMS" propertySpecifier="ID"/>

            </filter>

            <filter name="filtrarPorGrupoDataReprogramado" criteria="grupoTreinamento eq, dataReprogramado gte, dataReprogramado lt, removido eq">

            <annotation name="DMS" propertySpecifier="ID"/>

            </filter>

            <filter name="filtrarPorGrupoDataRealizado" criteria="grupoTreinamento eq, dataRealizado gte, dataRealizado lt, removido eq">

            <annotation name="DMS" propertySpecifier="ID"/>

            </filter>

            <filter name="filtrarPorGrupoPlaneamento" criteria="grupoTreinamento eq, removido eq">

            <annotation name="DMS" propertySpecifier="ID, dataPlaneamento"/>

            </filter>

            <filter name="filtrarPorGrupoRealizado" criteria="grupoTreinamento eq, removido eq">

            <annotation name="DMS" propertySpecifier="ID, dataRealizado"/>

            </filter>

            <filter name="filtrarPorGrupoReprogramado" criteria="grupoTreinamento eq, removido eq">

            <annotation name="DMS" propertySpecifier="ID, dataReprogramado"/>

            </filter>

            <filter name="filtrarPorOcupante" criteria="ocupante eq, removido eq"/>

            </entity>

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

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

            <annotation name="VisualModeler" width="154" height="207" x="391" y="868"/>

            <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="integer"/>

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

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

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

            <annotation name="DMS" lazy="false"/>

            </property>

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

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

            </entity>

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

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

            <annotation name="VisualModeler" width="181" height="158" x="141" y="546"/>

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

            <annotation name="service Group" service="UsuarioService"/>

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

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

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

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

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

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

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

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

            <filter name="fitrarPorAcessoSenha" criteria="acesso eq, senha eq"/>

            </entity>

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

            <annotation name="VisualModeler" x="144" y="19" width="233" height="496"/>

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

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

            <annotation name="service Group" service="PlaneamentoService,FuncionarioService,UsuarioService"/>

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

            <annotation name="DMS" paging-enabled="true" page-size="21"/>

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

            <property name="codigo" type="string" required="true" unique="true"/>

            <property name="matricula" type="string" required="true"/>

            <property name="supervisor" type="Funcionario"/>

            <property name="nomeCompleto" type="string" required="true"/>

            <property name="nacionalidade" type="string" required="true"/>

            <property name="sexo" type="string" required="true"/>

            <property name="dataNascimento" type="date"/>

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

            <property name="dataContratacao" type="date"/>

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

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

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

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

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

            <property name="dataRescisao" type="date"/>

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

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

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

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

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

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

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

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

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

            <filter name="filtrarNivelGerencia" criteria="nivelGerencia not like" order="nomeCompleto"/>

            <filter name="filtrarPeloNome" criteria="nomeCompleto like" order="nomeCompleto"/>

            <filter name="filtrarPelaMatricula" criteria="matricula like" order="matricula"/>

            </entity>

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

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

            <annotation name="VisualModeler" width="160" height="142" x="1027" y="920"/>

            <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="removido" type="boolean" default="false"/>

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

            </entity>

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

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

            <annotation name="VisualModeler" width="179" height="399" x="1183" y="347"/>

            <annotation name="DMS" paging-enabled="true" page-size="21"/>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            <property name="dataAdmissao" type="date"/>

            <property name="dataDesligamento" type="date"/>

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

            <filter name="filtrarPeloNome" criteria="nome like, removido eq" order="nome"/>

            <filter name="filtrarPelaMatricula" criteria="matricula like, removido eq" order="matricula"/>

            <filter name="filtrarPeloCodigo" criteria="codigo like, removido eq" order="codigo"/>

            <filter name="filtrarPorL1" criteria="supervisaoL1 like, removido eq" order="supervisaoL1"/>

            <filter name="filtrarPorL2" criteria="gerenciaAreaL2 like, removido eq" order="gerenciaAreaL2"/>

            <filter name="filtrarPorL3" criteria="gerenciaGeralL3 like, removido eq" order="gerenciaGeralL3"/>

            </entity>

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

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

            <annotation name="VisualModeler" width="115" height="94" x="141" y="734"/>

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

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

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

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

            </entity>

            </model>

             

             

            could you send me your email so i can send it the project in attach?

             

            I am using tab manager, so this error just happens once (first time) when i open the tab and then after it works fine.

             

             

            thanks,

            Imraan

            • 3. Re: Same data store
              imran_issufo Level 1

              I forgot to mention that the relationship is UNIDIRECTIONAL.

              When i change to BIDIRECTIONAL its works fine. But i want use UNIDIRECTIONAL because BIDIRECTIONAL caches the relationship (at least the ID) even when it is LAZY, and there is lot of data.

              I dont know how to make a workround on that.

              At the end when i did UNIDIRECTIONAL it works very fast, and actually i dont need to have BIDIRECTIONAL.

               

               

              regards

              Imraan