Announcement

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

    Problem with findByKeys method in 6.5.1

    Hello,

    We saw the following issue with findByKeys and wondering if you have any insight why this would happen and whether a simple null check to fix the issue makes sense?


    offending code:
    Code:
    
    //findByKeys is called by updateCacheData
    ,isc.A.updateCacheData=function(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.allRows!=null,_4=_3?this.allRows:this.localData,_5=0,_6=0,_7=0;var _8=this.getDataSource().getPrimaryKeyFields();for(var i=0;i<_1.length;i++){var _10=_1[i],_11=isc.applyMask(_10,_8);var _12=this.getDataSource().findByKeys(_11,_4),_13;if(_12==-1){var _14=_2.data;if(isc.isAn.Array(_14))_14=_14[0];_14=isc.applyMask(_14,_8);var _15=this.getDataSource().findByKeys(_14,_4);if(_15!=-1){this.logWarn("Update operation - submitted record with primary key value[s]:"+this.echo(_14)+" returned with modified primary key:"+this.echo(_11)+". This may indicate bad server logic. Updating cache to reflect new primary key.");_6++;_4.removeAt(_15);delete this.$573}}else if(_1.length==1){_13=_4.get(_12);if(_3&&!this.getDataSource().recordMatchesFilter(_13,this.criteria,this.context))
    
    
    //_2 is passed in as null creating stack you see in next block below
    ,isc.A.findByKeys=function(_1,_2,_3,_4){return _2.findByKeys(_1,this,_3,_4)}

    Firebug output
    Code:
    _2 is null
    anonymous(Object assetScenarioID=579, Object name=_2, Object name=_3, Object name=_4)ISC_Data...=6.5.1.js (line 579)
    anonymous([Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 917)
    anonymous("update", [Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 912)
    anonymous("update", [Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object name=_3 value=false, Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 907)
    anonymous(Object operationType=update dataSource=AssetScenario, Object operationId=custom clientContext=Object)ISC_Data...=6.5.1.js (line 903)
    anonymous(Object operationId=custom clientContext=Object, Object operationType=update dataSource=AssetScenario)ISC_Core...=6.5.1.js (line 102)
    anonymous(Object operationId=custom clientContext=Object, Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 286)
    anonymous(Object operationId=custom clientContext=Object, Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 265)
    anonymous([Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object operationId=custom clientContext=Object, Object operationType=update dataSource=AssetScenario, Object operationId=custom clientContext=Object, Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 437)
    anonymous(Object operationId=custom clientContext=Object, [Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object operationType=update dataSource=AssetScenario)ISC_Data...=6.5.1.js (line 1090)
    anonymous(Object target=[DataSource ID:AssetScenario], "rpcResponse,data,rpcRequest", [Object operationId=custom clientContext=Object, [Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object operationType=update dataSource=AssetScenario 0=Object 1=[1] 2=Object Class=Array], [DataSource ID:AssetScenario] ns=Object spring=urn:jsptld:/WEB-INF/spring.tld, Object name=_5)ISC_Core...=6.5.1.js (line 264)
    anonymous(Object target=[DataSource ID:AssetScenario], "rpcResponse,data,rpcRequest", [Object operationId=custom clientContext=Object, [Object assetID=3910 assetScenarioID=579 0=Object Class=Array], Object operationType=update dataSource=AssetScenario 0=Object 1=[1] 2=Object Class=Array], Object name=_4)ISC_Core...=6.5.1.js (line 356)
    anonymous(Object target=[DataSource ID:AssetScenario], Object operationType=update dataSource=AssetScenario, Object operationId=custom clientContext=Object, [Object assetID=3910 assetScenarioID=579 0=Object Class=Array])ISC_Data...=6.5.1.js (line 776)
    anonymous(Object operationType=update dataSource=AssetScenario, Object operationId=custom clientContext=Object)ISC_Data...=6.5.1.js (line 780)
    anonymous(Object operationType=update dataSource=AssetScenario, Object operationId=custom clientContext=Object)ISC_Data...=6.5.1.js (line 775)
    anonymous(31)ISC_Data...=6.5.1.js (line 769)
    anonymous(31, "//isc_RPCResponseStart-->[\n {\n isDSResponse:true,\n invalidateCache:false,\n status:0,\n data:[\n {\n ask:null,\n assetID:3910,\n assetIDList:null,\n assetName:null,\n assetScenarioID:579,\n assetTickerSymbol:"3",\n autoGenerated:false,\n bid:null,\n calculatedDelta:null,\n createdUserID:null,\n createdUserName:"Smith, Dean",\n currencyCode:null,\n currentPrice:null,\n delta:null,\n departmentID:null,\n exchange:null,\n expirationDate:null,\n fundScenarioTemplateID:null,\n fundVersion:null,\n impliedDelta:null,\n impliedVolatility:null,\n includeScenario:true,\n modifiedUserID:null,\n modifiedUserName:"Smith, Dean",\n notes:null,\n occurenceDate:null,\n optionOccurenceDateCallTickerExchangeID:null,\n optionOccurenceDateCallTickerSymbol:null,\n optionOccurenceDatePutTickerExchangeID:null,\n optionOccurenceDatePutTickerSymbol:null,\n optionOccurenceDateTickerExchangeID:null,\n optionOccurenceDateTickerSymbol:null,\n optionOneYearTickerSymbol:null,\n priceTarget:105.0,\n probability:100,\n scenarioName:"s1",\n strikePrice:null,\n undersymbol:null,\n undersymbolCurrentPrice:null,\n version:2,\n volatility:null,\n yield:null,\n created:Date.parseServerDate(2009,0,30),\n modified:Date.parseServerDate(2009,11,16)\n }\n ]\n }\n]//isc_RPCResponseEnd", Object name=_3)ISC_Data...=6.5.1.js (line 751)
    anonymous(31, "//isc_RPCResponseStart-->[\n {\n isDSResponse:true,\n invalidateCache:false,\n status:0,\n data:[\n {\n ask:null,\n assetID:3910,\n assetIDList:null,\n assetName:null,\n assetScenarioID:579,\n assetTickerSymbol:"3",\n autoGenerated:false,\n bid:null,\n calculatedDelta:null,\n createdUserID:null,\n createdUserName:"Smith, Dean",\n currencyCode:null,\n currentPrice:null,\n delta:null,\n departmentID:null,\n exchange:null,\n expirationDate:null,\n fundScenarioTemplateID:null,\n fundVersion:null,\n impliedDelta:null,\n impliedVolatility:null,\n includeScenario:true,\n modifiedUserID:null,\n modifiedUserName:"Smith, Dean",\n notes:null,\n occurenceDate:null,\n optionOccurenceDateCallTickerExchangeID:null,\n optionOccurenceDateCallTickerSymbol:null,\n optionOccurenceDatePutTickerExchangeID:null,\n optionOccurenceDatePutTickerSymbol:null,\n optionOccurenceDateTickerExchangeID:null,\n optionOccurenceDateTickerSymbol:null,\n optionOneYearTickerSymbol:null,\n priceTarget:105.0,\n probability:100,\n scenarioName:"s1",\n strikePrice:null,\n undersymbol:null,\n undersymbolCurrentPrice:null,\n version:2,\n volatility:null,\n yield:null,\n created:Date.parseServerDate(2009,0,30),\n modified:Date.parseServerDate(2009,11,16)\n }\n ]\n }\n]//isc_RPCResponseEnd", Object name=wd)ISC_Data...l/seq/194 (line -707)
    anonymous("isc.RPCManager.performTransactionReply(transactionNum,results,wd)", "transactionNum,results,wd", [31, "//isc_RPCResponseStart-->[\n {\n isDSResponse:true,\n invalidateCache:false,\n status:0,\n data:[\n {\n ask:null,\n assetID:3910,\n assetIDList:null,\n assetName:null,\n assetScenarioID:579,\n assetTickerSymbol:"3",\n autoGenerated:false,\n bid:null,\n calculatedDelta:null,\n createdUserID:null,\n createdUserName:"Smith, Dean",\n currencyCode:null,\n currentPrice:null,\n delta:null,\n departmentID:null,\n exchange:null,\n expirationDate:null,\n fundScenarioTemplateID:null,\n fundVersion:null,\n impliedDelta:null,\n impliedVolatility:null,\n includeScenario:true,\n modifiedUserID:null,\n modifiedUserName:"Smith, Dean",\n notes:null,\n occurenceDate:null,\n optionOccurenceDateCallTickerExchangeID:null,\n optionOccurenceDateCallTickerSymbol:null,\n optionOccurenceDatePutTickerExchangeID:null,\n optionOccurenceDatePutTickerSymbol:null,\n optionOccurenceDateTickerExchangeID:null,\n optionOccurenceDateTickerSymbol:null,\n optionOneYearTickerSymbol:null,\n priceTarget:105.0,\n probability:100,\n scenarioName:"s1",\n strikePrice:null,\n undersymbol:null,\n undersymbolCurrentPrice:null,\n version:2,\n volatility:null,\n yield:null,\n created:Date.parseServerDate(2009,0,30),\n modified:Date.parseServerDate(2009,11,16)\n }\n ]\n }\n]//isc_RPCResponseEnd", undefined 0=31], Window dpt.form, Object name=_5)ISC_Core...=6.5.1.js (line 264)
    anonymous(31, "//isc_RPCResponseStart-->[\n {\n isDSResponse:true,\n invalidateCache:false,\n status:0,\n data:[\n {\n ask:null,\n assetID:3910,\n assetIDList:null,\n assetName:null,\n assetScenarioID:579,\n assetTickerSymbol:"3",\n autoGenerated:false,\n bid:null,\n calculatedDelta:null,\n createdUserID:null,\n createdUserName:"Smith, Dean",\n currencyCode:null,\n currentPrice:null,\n delta:null,\n departmentID:null,\n exchange:null,\n expirationDate:null,\n fundScenarioTemplateID:null,\n fundVersion:null,\n impliedDelta:null,\n impliedVolatility:null,\n includeScenario:true,\n modifiedUserID:null,\n modifiedUserName:"Smith, Dean",\n notes:null,\n occurenceDate:null,\n optionOccurenceDateCallTickerExchangeID:null,\n optionOccurenceDateCallTickerSymbol:null,\n optionOccurenceDatePutTickerExchangeID:null,\n optionOccurenceDatePutTickerSymbol:null,\n optionOccurenceDateTickerExchangeID:null,\n optionOccurenceDateTickerSymbol:null,\n optionOneYearTickerSymbol:null,\n priceTarget:105.0,\n probability:100,\n scenarioName:"s1",\n strikePrice:null,\n undersymbol:null,\n undersymbolCurrentPrice:null,\n version:2,\n volatility:null,\n yield:null,\n created:Date.parseServerDate(2009,0,30),\n modified:Date.parseServerDate(2009,11,16)\n }\n ]\n }\n]//isc_RPCResponseEnd", Object name=_3)ISC_Data...=6.5.1.js (line 1107)
    onload(load )ISC_Core...=6.5.1.js (line 1)
     ,isc.A.findByKeys=function(_1,_2,_3,_4){return _2.findByKeys(_1,this,_3,_4)}\nISC_Data...=6.5.1.js (line 579)

    #2
    This suggests that a grid's cache has been invalidated, and there is code in an event handler or elsewhere that does not check for this condition (which you could check with ResultSet.lengthIsKnown()) and tries to do something record-oriented (like maybe select a record).

    It looks like an actual crash here has already been fixed with a null check in 7.0.

    Comment

    Working...
    X