Announcement

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

    UpdateWithoutPKException -- customInsertExpression

    hi,

    I get a UpdateWithoutPKException (within an add operation) although I've entered a "customInsertExpression" in the primaryKey Field at sqldatasource level.

    Code:
    com.isomorphic.base.UpdateWithoutPKException: Criteria received from the client for add operation is missing the following non-sequence primary key fields: [XXTSTAMP]. Either provide all primary key fields that are not sequences, or set allowMultiUpdate on the OperationBinding
    	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1266)
    	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:306)
    	at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:258)
    there is my field definition:
    Code:
    <field name="XXTSTAMP" 
       customInsertExpression="CURRENT TIMESTAMP" 
       customSelectExpression="CAST(XXTSTAMP AS VARCHAR(26))" 
       title="Timestamp" 
       hidden="true"  
       primaryKey="true" 
     />
    meaning of "current timestamp" in DB2: http://publib.boulder.ibm.com/infoce...ttimestamp.htm

    I think in this case there should be no exception as the primaryKey is filled during update sql.

    what do you think about?

    best regards,
    timo

    P.S.: The "allowMultiUpdate" option solves the problem, but I think in this case there should be no exception.


    Isomorphic SmartClient/SmartGWT Framework (v8.3d_2012-11-08/EVAL Deployment 2012-11-08)
    Last edited by tmoes; 14 Nov 2012, 09:01.

    #2
    We need the primaryKey for multiple purposes including returning a response that allows the client to update cache, so we would not want to simply turn off this check because of a customInsertExpression. Having to set allowMultiUpdate makes sense here; another option would be operationType:"custom".

    Comment

    Working...
    X