locked
Command Table Pattern MySQL DiscardChanges error RRS feed

  • Question

  • Hello

    I am exploring creating a project in LS with a MySQL DataSource, evrything seems to be working fine but I tryed to create a Table Command Pattern and I am having a problem when discarding changes.

     partial void Comandos_Inserting(Comando entity)
            {
    
                CommandHelper.Ejecutar(entity);
                this.Details.DiscardChanges();
            }

    When I call the DiscardChanges the applications throws me thie exception:

    "An entity with the same identity already exists in this EntitySet"

    I checked the Table Mapping in the LSML file to see if something was not corectly mapped and it is good as far as I can see:

    <SsdlEntitySet Schema="lanceplayer"
                           Table="comandos" />
            <SsdlProperty Name="Id"
                          Nullable="False"
                          Property="Comando/Properties[Id]"
                          StoreGeneratedPattern="Identity"
                          Type="int" />
    
    
    <!--------------------------
    
    <EntityType Name="Comando">
        <EntityType.Methods>
          <EntityMethod Name="Delete">
            <EntityMethod.Attributes>
              <Generated />
            </EntityMethod.Attributes>
          </EntityMethod>
        </EntityType.Methods>
        <EntityType.Properties>
          <KeyProperty IsReadOnly="True"
                       Name="Id"
                       PropertyType=":Int32">
            <KeyProperty.Attributes>
              <Required />
              <NotSearchable />
            </KeyProperty.Attributes>
          </KeyProperty>

    Is this a MySQL Connectr issue or something related to LS? Because if I comment the DiscardChanges line it submits correctly and insertes the Command register in the table with no problems.

    This is no a big problem, but I would like to know if I am doing somthing wrong if I need to use this feature in the future XD.

    Thanks :D



    SebaXOR


    • Edited by sebaxor Saturday, May 18, 2013 2:41 PM specific title
    Saturday, May 18, 2013 2:31 PM