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

  • add error with included field which is primary key from another dataSource

    SmartClient Version: SNAPSHOT_v12.1d_2019-05-15/EVAL Deployment (expires 2019.07.14_07.21.56) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    Hello, I've got a dataSource with an includeFrom field, which is included via two joins, ie includeFrom="dsA.dsB.ID_REC", and ID_REC is the primaryKey of the dsB.

    If I execute, client side, an addData, I get this error:

    2019-05-16T22:00:09,951 WARN  RequestContext dsRequest.execute() failed:  
    com.isomorphic.base.UpdateWithoutPKException: Criteria received from the client for add operation is missing the following non-sequence primary key fields: [ID_REC]. Either provide all primary key fields that are not sequences, or set allowMultiUpdate on the OperationBinding
        at com.isomorphic.sql.SQLDataSource.SQLExecute( ~[isomorphic_sql.jar:?]
        at com.isomorphic.sql.SQLDataSource.processRequest( ~[isomorphic_sql.jar:?]
        at com.isomorphic.sql.SQLDataSource.executeAdd( ~[isomorphic_sql.jar:?]
        at com.isomorphic.datasource.DataSource.execute( ~[isomorphic_core_rpc.jar:?]
        at com.isomorphic.application.AppBase.executeDefaultDSOperation( ~[isomorphic_core_rpc.jar:?]
        at com.isomorphic.application.AppBase.executeAppOperation( ~[isomorphic_core_rpc.jar:?]
        at com.isomorphic.application.AppBase.execute( ~[isomorphic_core_rpc.jar:?]
        at com.isomorphic.datasource.DSRequest.execute( ~[isomorphic_core_rpc.jar:?]
        at com.isomorphic.servlet.IDACall.handleDSRequest( [isomorphic_core_rpc.jar:?]
    it seems as it's trying to use the includeFrom primary key in the insert (while it must be excluded).

    The workaround is actually simple, as the join is already present due to other included fields, I'm using a customSelectExpression for this field.

    Nevertheless, I think this is a bug.

  • #2
    mh, maybe I could do it in a simpler way, as includeFrom="dsA.fk_to_dsB", I'll test it.