Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    creator, creatorTimestamp, modifier, modifierTimestamp, Dropped on Adding Multiple Records

    Version: SmartClient Version: v13.0p_2022-05-25/Enterprise Deployment (built 2022-05-25)

    We're calling DSRequest.setValues() from the server with List<Map>> to add multiple records. When we do this only the first record gets the creator, creatorTimestamp, modifier, modifierTimestamp fields filled in.

    Here's our ds.xml:

    Code:
    <DataSource ID="DoorFscLeedSQL"
                serverType="sql"
                tableName="door_fsc_leed"
                dropExtraFields="false">
        <fields>
            <field name="door_fsc_leed_id" type="sequence" primaryKey="true"/>
            <field name="door_id" type="integer" hidden="true" foreignKey="DoorSQL.doorId" joinType="outer"/>
    
            <field name="code_id" type="integer" foreignKey="CodeSQL.code_id" joinType="outer"/>
            <field name="code" type="text" length="100" includeFrom="CodeSQL.code"/>
            <field name="description" type="text" length="100" includeFrom="CodeSQL.description"/>
            <field name="codeTypeId" type="integer" includeFrom="CodeSQL.code_type_id"/>
            <field name="concatValue" type="text" includeFrom="CodeSQL.concatValue"/>
    
            <field name="created_by" type="creator"/>
            <field name="created_time" type="creatorTimestamp"/>
            <field name="modified_by" type="modifier"/>
            <field name="modified_time" type="modifierTimestamp"/>
        </fields>
    </DataSource>
    Here's an example of the logs while adding 2 records:

    Code:
    2022-08-09 14:23:16.835 INFO com.isomorphic.datasource.DSRequest:228 - - Executing DoorFscLeedSQL.add with
    criteria: {}
    values: 2 valueSets
    2022-08-09 14:23:16.849 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.874 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.889 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.904 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.921 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.938 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.953 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.971 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:16.987 WARN com.isomorphic.datasource.DSRequest:220 - - getValues() called on dsRequest containing multiple sets of values, returning first in list.
    2022-08-09 14:23:17.040 INFO com.isomorphic.sql.SQLDriver:228 - - Executing SQL query on 'Mysql':
        INSERT
        INTO
            door_fsc_leed
            (code_id, created_by, created_time, door_id, modified_by, modified_time, door_fsc_leed_id)
        VALUES
            (-561004, '11', '2022-08-09 14:23:11', 608, '11', '2022-08-09 14:23:11', NULL)
    2022-08-09 14:23:17.136 INFO com.isomorphic.sql.SQLDriver:228 - - Executing SQL query on 'Mysql':
        SELECT
            LAST_INSERT_ID()
    2022-08-09 14:23:17.242 INFO com.isomorphic.sql.SQLDataSource:228 - - primaryKeys: {door_fsc_leed_id=5}
    2022-08-09 14:23:17.283 INFO com.isomorphic.datasource.DSRequest:228 - - Executing DoorFscLeedSQL.fetch rows: 0->-1 with
    criteria: {door_fsc_leed_id:5}
    2022-08-09 14:23:17.347 INFO com.isomorphic.sql.SQLDataSource:228 - - 164: Executing cache sync query on 'Mysql':
        SELECT
            door_fsc_leed.door_fsc_leed_id, door_fsc_leed.door_id, door_fsc_leed.code_id, door_fsc_leed.created_by, door_fsc_leed.created_time, door_fsc_leed.modified_by, door_fsc_leed.modified_time, code.code, code.description, code.code_type_id AS codeTypeId, CONCAT(code.code, '-', code.description) AS concatValue
        FROM
            door_fsc_leed
        LEFT OUTER JOIN
            code
                ON door_fsc_leed.code_id = code.code_id
        WHERE
            (
                door_fsc_leed.door_fsc_leed_id=5
            ) LIMIT 0, 1
    2022-08-09 14:23:17.434 INFO com.isomorphic.datasource.DSResponse:228 - - DSResponse: List with 1 items
    2022-08-09 14:23:17.474 INFO com.isomorphic.sql.SQLDriver:228 - - Executing SQL query on 'Mysql':
        INSERT
        INTO
            door_fsc_leed
            (code_id, door_id, door_fsc_leed_id)
        VALUES
            (-561005, 608, NULL)
    2022-08-09 14:23:17.568 INFO com.isomorphic.sql.SQLDriver:228 - - Executing SQL query on 'Mysql':
        SELECT
            LAST_INSERT_ID()
    2022-08-09 14:23:17.667 INFO com.isomorphic.sql.SQLDataSource:228 - - primaryKeys: {door_fsc_leed_id=6}
    2022-08-09 14:23:17.702 INFO com.isomorphic.datasource.DSRequest:228 - - Executing DoorFscLeedSQL.fetch rows: 0->-1 with
    criteria: {door_fsc_leed_id:6}
    2022-08-09 14:23:17.775 INFO com.isomorphic.sql.SQLDataSource:228 - - 164: Executing cache sync query on 'Mysql':
        SELECT
            door_fsc_leed.door_fsc_leed_id, door_fsc_leed.door_id, door_fsc_leed.code_id, door_fsc_leed.created_by, door_fsc_leed.created_time, door_fsc_leed.modified_by, door_fsc_leed.modified_time, code.code, code.description, code.code_type_id AS codeTypeId, CONCAT(code.code, '-', code.description) AS concatValue
        FROM
            door_fsc_leed
        LEFT OUTER JOIN
            code
                ON door_fsc_leed.code_id = code.code_id
        WHERE
            (
                door_fsc_leed.door_fsc_leed_id=6
            ) LIMIT 0, 1
    In the second INSERT statement all of the creator, creatorTimestamp, modifier, modifierTimestamp fields are missing.

    I know we can create a separate DSRequest for each record to be inserted, but is this something that can be fixed?

    Thanks!

    #2
    We'll note this down to be fixed - there's no reason this shouldn't work, but it's obscure.

    In the meantime, you can use multiple dsRequests.

    Comment


      #3
      Thank you for the quick response. Do you have a relative ETA for the fix? I'm just looking for an approximate timeline before I commit to refactoring our code. If the fix would be a less than a month, we would probably wait. Thank you!

      Comment


        #4
        Sorry, since you do not have support, there's no way to tell. It could be the very next task and be bumped for a long time by tasks from supported customers.

        Comment


          #5
          Any update on this one? We would really like a fix to this one.

          Comment


            #6
            Apologies for the delayed response. This is fixed and available for download in nightly builds since Aug 16.

            Comment


              #7
              Thank you, much appreciated. We will try it out and respond back if anything doesn't work as expected.

              Comment


                #8
                Confirmed fix is working, thank you!

                Comment

                Working...
                X