Announcement

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

    SQL Templating, $values not resolved?

    Hello, using SmartGWT 3.0 Power,

    I have an operationbinding that deletes all rows from a certain student, like so.
    Code:
        <operationBinding operationType="remove" requiresAuthentication="true" requiresRole="CAN_DELETE_COURSEOPTIONSELECTION" operationId="DeleteOldSelection" allowMultiUpdate="true"> 
        <whereClause>students_id='$values.students_id'</whereClause>
        </operationBinding>
    According to these docs http://www.smartclient.com/smartgwte...mQuerying.html, i should be able to user $values.students_id right?

    My Client side code triggering this operatin is like so:
    Code:
    DataSource selDs = DataSource.get("CourseOptionSelection");
    DSRequest req = new DSRequest();
    req.setOperationId("DeleteOldSelection");
    	
    String id = record.getAttribute("students_id");
    Record r= new Record();
    if(id == null || id == ""){
    	Log.warn("No row selected, not running the save, since everything would be deleted.");
    	return;
    }
    r.setAttribute("students_id", id); //currently selected record
    selDs.removeData(r, new DSCallback(){
    	public void execute(DSResponse response, Object rawData, DSRequest request) {}
    },req);

    This is what the logs say:
    Code:
    === 2012-01-05 19:06:27,716 [l0-6] INFO  SQLDriver - [builtinApplication.DeleteOldSelection] Executing SQL update on 'Mysql': DELETE FROM CourseOptionSelection WHERE students_id='$values.students_id'
    What am I missing / doing wrong?

    #2
    The expression is not working because students_id is not present in the request. Take a look at the preceding server-side logs and you should see that it's absent, despite your attempt to send it. If you need more help, post the complete server-side log for the request.

    Comment


      #3
      Indeed, it is not sent to the server, it is not in the request.

      If I log the 'id' variable on the client that is put in the Record, it does show a correct value:
      Code:
      Log.debug("Removing all rows of students_id: "+ id);
      // ... logs ...
       (SubscriptionDetailsWidget.java:913) 2012-01-06 09:01:57,407 [DEBUG] Removing all rows of students_id: 17
      So it should be in the request?

      See the server log of the request (long, since multiple DSRequests are running at once, but I don't wanna cut stuff out of the log):
      Code:
      (SubscriptionDetailsWidget.java:913) 2012-01-06 09:07:50,086 [DEBUG] Removing all rows of students_id: 17
      === 2012-01-06 09:07:50,135 [l0-8] INFO  RequestContext - URL: '/generatedcode/sc/IDACall', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1': Moz (Gecko) with Accept-Encoding header
      +++ [INFO,LoggerListener,btpool0-8] Security authorized for authenticated principal: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@699f6e00: Principal: nl.sytematic.projects.Technicom.server.security.SytematicSaltedUser@99ac08b4: Username: superadmin; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: CAN_CHANGE_PASSWORD,CAN_CREATE_BLOCK,CAN_CREATE_COHORT,CAN_CREATE_COMPANY,CAN_CREATE_CONTACTPERSON,CAN_CREATE_COURSE,CAN_CREATE_COURSEBLOCKTEMPLATE,CAN_CREATE_COURSECORRESPONDENCE,CAN_CREATE_COURSECORRESPONDENCELOG,CAN_CREATE_COURSEEDITION,CAN_CREATE_COURSEEDITION_STUDENTS_STUDENT,CAN_CREATE_COURSEEDITION_TEACHERS_TEACHER,CAN_CREATE_COURSEEXAMTEMPLATE,CAN_CREATE_COURSEOPTION,CAN_CREATE_COURSEOPTIONSELECTION,CAN_CREATE_COURSEOPTIONSELECTION_TAB,CAN_CREATE_COURSEOPTIONVALUE,CAN_CREATE_COURSEOPTIONVALUE_TAB,CAN_CREATE_COURSEOPTION_OPTIONVALUES_COURSEOPTIONV,CAN_CREATE_COURSEOPTION_TAB,CAN_CREATE_CREBOINSTITUTE,CAN_CREATE_EXAM,CAN_CREATE_EXAMREGULATION,CAN_CREATE_EXAM_PARTICIPANTS_STUDENT,CAN_CREATE_GRADETYPE,CAN_CREATE_LECTURE,CAN_CREATE_LECTURETEMPLATE,CAN_CREATE_LECTURE_PRESENCE_STUDENT,CAN_CREATE_LOCATION,CAN_CREATE_PROJECT,CAN_CREATE_STUDENT,CAN_CREATE_STUDENTFILE,CAN_CREATE_STUDENTNOTE,CAN_CREATE_TEACHER,CAN_CREATE_TEACHER_ALLOWED_COURSE,CAN_CREATE_TEACHINGPLAN,CAN_CREATE_THESISSUBMITDATE,CAN_CREATE_USERACCOUNT,CAN_DELETE_BLOCK,CAN_DELETE_COHORT,CAN_DELETE_COMPANY,CAN_DELETE_CONTACTPERSON,CAN_DELETE_COURSE,CAN_DELETE_COURSEBLOCKTEMPLATE,CAN_DELETE_COURSECORRESPONDENCE,CAN_DELETE_COURSECORRESPONDENCELOG,CAN_DELETE_COURSEEDITION,CAN_DELETE_COURSEEDITION_STUDENTS_STUDENT,CAN_DELETE_COURSEEDITION_TEACHERS_TEACHER,CAN_DELETE_COURSEEXAMTEMPLATE,CAN_DELETE_COURSEOPTION,CAN_DELETE_COURSEOPTIONSELECTION,CAN_DELETE_COURSEOPTIONSELECTION_TAB,CAN_DELETE_COURSEOPTIONVALUE,CAN_DELETE_COURSEOPTIONVALUE_TAB,CAN_DELETE_COURSEOPTION_OPTIONVALUES_COURSEOPTIONV,CAN_DELETE_COURSEOPTION_TAB,CAN_DELETE_CREBOINSTITUTE,CAN_DELETE_EXAM,CAN_DELETE_EXAMREGULATION,CAN_DELETE_EXAM_PARTICIPANTS_STUDENT,CAN_DELETE_GRADETYPE,CAN_DELETE_LECTURE,CAN_DELETE_LECTURETEMPLATE,CAN_DELETE_LECTURE_PRESENCE_STUDENT,CAN_DELETE_LOCATION,CAN_DELETE_PROJECT,CAN_DELETE_STUDENT,CAN_DELETE_STUDENTFILE,CAN_DELETE_STUDENTNOTE,CAN_DELETE_TEACHER,CAN_DELETE_TEACHER_ALLOWED_COURSE,CAN_DELETE_TEACHINGPLAN,CAN_DELETE_THESISSUBMITDATE,CAN_DELETE_USERACCOUNT,CAN_READ_BLOCK,CAN_READ_BLOCK_TAB,CAN_READ_COHORT,CAN_READ_COHORT_TAB,CAN_READ_COMPANY,CAN_READ_COMPANY_TAB,CAN_READ_CONTACTPERSON,CAN_READ_CONTACTPERSON_TAB,CAN_READ_COURSE,CAN_READ_COURSEBLOCKTEMPLATE,CAN_READ_COURSEBLOCKTEMPLATE_TAB,CAN_READ_COURSECORRESPONDENCE,CAN_READ_COURSECORRESPONDENCELOG,CAN_READ_COURSECORRESPONDENCELOG_TAB,CAN_READ_COURSECORRESPONDENCE_TAB,CAN_READ_COURSEEDITION,CAN_READ_COURSEEDITION_STUDENTS_STUDENT,CAN_READ_COURSEEDITION_TAB,CAN_READ_COURSEEDITION_TEACHERS_TEACHER,CAN_READ_COURSEEXAMTEMPLATE,CAN_READ_COURSEEXAMTEMPLATE_TAB,CAN_READ_COURSEMANAGEMENTREPORTS_TAB,CAN_READ_COURSEOPTION,CAN_READ_COURSEOPTIONSELECTION,CAN_READ_COURSEOPTIONSELECTION_TAB,CAN_READ_COURSEOPTIONVALUE,CAN_READ_COURSEOPTIONVALUE_TAB,CAN_READ_COURSEOPTION_OPTIONVALUES_COURSEOPTIONVAL,CAN_READ_COURSEOPTION_TAB,CAN_READ_COURSE_TAB,CAN_READ_CREBOINSTITUTE,CAN_READ_CREBOINSTITUTE_TAB,CAN_READ_EXAM,CAN_READ_EXAMREGULATION,CAN_READ_EXAMREGULATION_TAB,CAN_READ_EXAM_PARTICIPANTS_STUDENT,CAN_READ_EXAM_TAB,CAN_READ_GRADETYPE,CAN_READ_GRADETYPE_TAB,CAN_READ_LECTURE,CAN_READ_LECTURETEMPLATE,CAN_READ_LECTURETEMPLATE_TAB,CAN_READ_LECTURE_PRESENCE_STUDENT,CAN_READ_LECTURE_TAB,CAN_READ_LOCATION,CAN_READ_LOCATION_TAB,CAN_READ_MY_ACCOUNT,CAN_READ_PROJECT,CAN_READ_PROJECT_TAB,CAN_READ_STUDENT,CAN_READ_STUDENTFILE,CAN_READ_STUDENTFILE_TAB,CAN_READ_STUDENTNOTE,CAN_READ_STUDENTNOTE_TAB,CAN_READ_STUDENT_TAB,CAN_READ_TEACHER,CAN_READ_TEACHER_ALLOWED_COURSE,CAN_READ_TEACHER_TAB,CAN_READ_TEACHINGPLAN,CAN_READ_TEACHINGPLAN_TAB,CAN_READ_THESISSUBMITDATE,CAN_READ_THESISSUBMITDATE_TAB,CAN_READ_USER_MANAGEMENT,CAN_UPDATE_BLOCK,CAN_UPDATE_COHORT,CAN_UPDATE_COMPANY,CAN_UPDATE_CONTACTPERSON,CAN_UPDATE_COURSE,CAN_UPDATE_COURSEBLOCKTEMPLATE,CAN_UPDATE_COURSECORRESPONDENCE,CAN_UPDATE_COURSECORRESPONDENCELOG,CAN_UPDATE_COURSEEDITION,CAN_UPDATE_COURSEEDITION_STUDENTS_STUDENT,CAN_UPDATE_COURSEEDITION_TEACHERS_TEACHER,CAN_UPDATE_COURSEEXAMTEMPLATE,CAN_UPDATE_COURSEOPTION,CAN_UPDATE_COURSEOPTIONSELECTION,CAN_UPDATE_COURSEOPTIONSELECTION_TAB,CAN_UPDATE_COURSEOPTIONVALUE,CAN_UPDATE_COURSEOPTIONVALUE_TAB,CAN_UPDATE_COURSEOPTION_OPTIONVALUES_COURSEOPTIONV,CAN_UPDATE_COURSEOPTION_TAB,CAN_UPDATE_CREBOINSTITUTE,CAN_UPDATE_EXAM,CAN_UPDATE_EXAMREGULATION,CAN_UPDATE_EXAM_PARTICIPANTS_STUDENT,CAN_UPDATE_GRADETYPE,CAN_UPDATE_LECTURE,CAN_UPDATE_LECTURETEMPLATE,CAN_UPDATE_LECTURE_PRESENCE_STUDENT,CAN_UPDATE_LOCATION,CAN_UPDATE_PROJECT,CAN_UPDATE_STUDENT,CAN_UPDATE_STUDENTFILE,CAN_UPDATE_STUDENTNOTE,CAN_UPDATE_TEACHER,CAN_UPDATE_TEACHER_ALLOWED_COURSE,CAN_UPDATE_TEACHINGPLAN,CAN_UPDATE_THESISSUBMITDATE,CAN_VIEW_MAIN_PANEL,ROLE_ADMINISTRATOR,ROLE_SUPER_ADMINISTRATOR,ROLE_USER; Credentials: [PROTECTED]; Authenticated: true; Details: null; Granted Authorities: CAN_CHANGE_PASSWORD, CAN_CREATE_BLOCK, CAN_CREATE_COHORT, CAN_CREATE_COMPANY, CAN_CREATE_CONTACTPERSON, CAN_CREATE_COURSE, CAN_CREATE_COURSEBLOCKTEMPLATE, CAN_CREATE_COURSECORRESPONDENCE, CAN_CREATE_COURSECORRESPONDENCELOG, CAN_CREATE_COURSEEDITION, CAN_CREATE_COURSEEDITION_STUDENTS_STUDENT, CAN_CREATE_COURSEEDITION_TEACHERS_TEACHER, CAN_CREATE_COURSEEXAMTEMPLATE, CAN_CREATE_COURSEOPTION, CAN_CREATE_COURSEOPTIONSELECTION, CAN_CREATE_COURSEOPTIONSELECTION_TAB, CAN_CREATE_COURSEOPTIONVALUE, CAN_CREATE_COURSEOPTIONVALUE_TAB, CAN_CREATE_COURSEOPTION_OPTIONVALUES_COURSEOPTIONV, CAN_CREATE_COURSEOPTION_TAB, CAN_CREATE_CREBOINSTITUTE, CAN_CREATE_EXAM, CAN_CREATE_EXAMREGULATION, CAN_CREATE_EXAM_PARTICIPANTS_STUDENT, CAN_CREATE_GRADETYPE, CAN_CREATE_LECTURE, CAN_CREATE_LECTURETEMPLATE, CAN_CREATE_LECTURE_PRESENCE_STUDENT, CAN_CREATE_LOCATION, CAN_CREATE_PROJECT, CAN_CREATE_STUDENT, CAN_CREATE_STUDENTFILE, CAN_CREATE_STUDENTNOTE, CAN_CREATE_TEACHER, CAN_CREATE_TEACHER_ALLOWED_COURSE, CAN_CREATE_TEACHINGPLAN, CAN_CREATE_THESISSUBMITDATE, CAN_CREATE_USERACCOUNT, CAN_DELETE_BLOCK, CAN_DELETE_COHORT, CAN_DELETE_COMPANY, CAN_DELETE_CONTACTPERSON, CAN_DELETE_COURSE, CAN_DELETE_COURSEBLOCKTEMPLATE, CAN_DELETE_COURSECORRESPONDENCE, CAN_DELETE_COURSECORRESPONDENCELOG, CAN_DELETE_COURSEEDITION, CAN_DELETE_COURSEEDITION_STUDENTS_STUDENT, CAN_DELETE_COURSEEDITION_TEACHERS_TEACHER, CAN_DELETE_COURSEEXAMTEMPLATE, CAN_DELETE_COURSEOPTION, CAN_DELETE_COURSEOPTIONSELECTION, CAN_DELETE_COURSEOPTIONSELECTION_TAB, CAN_DELETE_COURSEOPTIONVALUE, CAN_DELETE_COURSEOPTIONVALUE_TAB, CAN_DELETE_COURSEOPTION_OPTIONVALUES_COURSEOPTIONV, CAN_DELETE_COURSEOPTION_TAB, CAN_DELETE_CREBOINSTITUTE, CAN_DELETE_EXAM, CAN_DELETE_EXAMREGULATION, CAN_DELETE_EXAM_PARTICIPANTS_STUDENT, CAN_DELETE_GRADETYPE, CAN_DELETE_LECTURE, CAN_DELETE_LECTURETEMPLATE, CAN_DELETE_LECTURE_PRESENCE_STUDENT, CAN_DELETE_LOCATION, CAN_DELETE_PROJECT, CAN_DELETE_STUDENT, CAN_DELETE_STUDENTFILE, CAN_DELETE_STUDENTNOTE, CAN_DELETE_TEACHER, CAN_DELETE_TEACHER_ALLOWED_COURSE, CAN_DELETE_TEACHINGPLAN, CAN_DELETE_THESISSUBMITDATE, CAN_DELETE_USERACCOUNT, CAN_READ_BLOCK, CAN_READ_BLOCK_TAB, CAN_READ_COHORT, CAN_READ_COHORT_TAB, CAN_READ_COMPANY, CAN_READ_COMPANY_TAB, CAN_READ_CONTACTPERSON, CAN_READ_CONTACTPERSON_TAB, CAN_READ_COURSE, CAN_READ_COURSEBLOCKTEMPLATE, CAN_READ_COURSEBLOCKTEMPLATE_TAB, CAN_READ_COURSECORRESPONDENCE, CAN_READ_COURSECORRESPONDENCELOG, CAN_READ_COURSECORRESPONDENCELOG_TAB, CAN_READ_COURSECORRESPONDENCE_TAB, CAN_READ_COURSEEDITION, CAN_READ_COURSEEDITION_STUDENTS_STUDENT, CAN_READ_COURSEEDITION_TAB, CAN_READ_COURSEEDITION_TEACHERS_TEACHER, CAN_READ_COURSEEXAMTEMPLATE, CAN_READ_COURSEEXAMTEMPLATE_TAB, CAN_READ_COURSEMANAGEMENTREPORTS_TAB, CAN_READ_COURSEOPTION, CAN_READ_COURSEOPTIONSELECTION, CAN_READ_COURSEOPTIONSELECTION_TAB, CAN_READ_COURSEOPTIONVALUE, CAN_READ_COURSEOPTIONVALUE_TAB, CAN_READ_COURSEOPTION_OPTIONVALUES_COURSEOPTIONVAL, CAN_READ_COURSEOPTION_TAB, CAN_READ_COURSE_TAB, CAN_READ_CREBOINSTITUTE, CAN_READ_CREBOINSTITUTE_TAB, CAN_READ_EXAM, CAN_READ_EXAMREGULATION, CAN_READ_EXAMREGULATION_TAB, CAN_READ_EXAM_PARTICIPANTS_STUDENT, CAN_READ_EXAM_TAB, CAN_READ_GRADETYPE, CAN_READ_GRADETYPE_TAB, CAN_READ_LECTURE, CAN_READ_LECTURETEMPLATE, CAN_READ_LECTURETEMPLATE_TAB, CAN_READ_LECTURE_PRESENCE_STUDENT, CAN_READ_LECTURE_TAB, CAN_READ_LOCATION, CAN_READ_LOCATION_TAB, CAN_READ_MY_ACCOUNT, CAN_READ_PROJECT, CAN_READ_PROJECT_TAB, CAN_READ_STUDENT, CAN_READ_STUDENTFILE, CAN_READ_STUDENTFILE_TAB, CAN_READ_STUDENTNOTE, CAN_READ_STUDENTNOTE_TAB, CAN_READ_STUDENT_TAB, CAN_READ_TEACHER, CAN_READ_TEACHER_ALLOWED_COURSE, CAN_READ_TEACHER_TAB, CAN_READ_TEACHINGPLAN, CAN_READ_TEACHINGPLAN_TAB, CAN_READ_THESISSUBMITDATE, CAN_READ_THESISSUBMITDATE_TAB, CAN_READ_USER_MANAGEMENT, CAN_UPDATE_BLOCK, CAN_UPDATE_COHORT, CAN_UPDATE_COMPANY, CAN_UPDATE_CONTACTPERSON, CAN_UPDATE_COURSE, CAN_UPDATE_COURSEBLOCKTEMPLATE, CAN_UPDATE_COURSECORRESPONDENCE, CAN_UPDATE_COURSECORRESPONDENCELOG, CAN_UPDATE_COURSEEDITION, CAN_UPDATE_COURSEEDITION_STUDENTS_STUDENT, CAN_UPDATE_COURSEEDITION_TEACHERS_TEACHER, CAN_UPDATE_COURSEEXAMTEMPLATE, CAN_UPDATE_COURSEOPTION, CAN_UPDATE_COURSEOPTIONSELECTION, CAN_UPDATE_COURSEOPTIONSELECTION_TAB, CAN_UPDATE_COURSEOPTIONVALUE, CAN_UPDATE_COURSEOPTIONVALUE_TAB, CAN_UPDATE_COURSEOPTION_OPTIONVALUES_COURSEOPTIONV, CAN_UPDATE_COURSEOPTION_TAB, CAN_UPDATE_CREBOINSTITUTE, CAN_UPDATE_EXAM, CAN_UPDATE_EXAMREGULATION, CAN_UPDATE_EXAM_PARTICIPANTS_STUDENT, CAN_UPDATE_GRADETYPE, CAN_UPDATE_LECTURE, CAN_UPDATE_LECTURETEMPLATE, CAN_UPDATE_LECTURE_PRESENCE_STUDENT, CAN_UPDATE_LOCATION, CAN_UPDATE_PROJECT, CAN_UPDATE_STUDENT, CAN_UPDATE_STUDENTFILE, CAN_UPDATE_STUDENTNOTE, CAN_UPDATE_TEACHER, CAN_UPDATE_TEACHER_ALLOWED_COURSE, CAN_UPDATE_TEACHINGPLAN, CAN_UPDATE_THESISSUBMITDATE, CAN_VIEW_MAIN_PANEL, ROLE_ADMINISTRATOR, ROLE_SUPER_ADMINISTRATOR, ROLE_USER; secure object: FilterInvocation: URL: /generatedcode/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2011-12-29&isc_xhr=1&isc_tnum=33; configuration attributes: [ROLE_USER, ROLE_ADMINISTRATOR, ROLE_SUPER_ADMINISTRATOR]
      === 2012-01-06 09:07:50,182 [l0-8] DEBUG XML - Parsed XML from (in memory stream): 2ms
      === 2012-01-06 09:07:50,185 [l0-8] DEBUG RPCManager - Processing 2 requests.
      === 2012-01-06 09:07:50,186 [l0-8] DEBUG RPCManager - Request #1 (DSRequest) payload: {
          criteria:{
          },
          operationConfig:{
              dataSource:"CourseOptionSelection",
              operationType:"remove"
          },
          appID:"builtinApplication",
          operation:"DeleteOldSelection",
          oldValues:{
          }
      }
      === 2012-01-06 09:07:50,187 [l0-8] DEBUG RPCManager - Request #2 (DSRequest) payload: {
          values:{
              students_id:"17",
              CourseOptionValue_id:"1"
          },
          operationConfig:{
              dataSource:"CourseOptionSelection",
              operationType:"add"
          },
          appID:"builtinApplication",
          operation:"CourseOptionSelection_add",
          oldValues:{
              students_id:"17",
              CourseOptionValue_id:"1"
          },
          criteria:{
          }
      }
      === 2012-01-06 09:07:50,190 [l0-8] DEBUG AppBase - [builtinApplication.DeleteOldSelection] No userTypes defined, allowing anyone access to all operations for this application
      === 2012-01-06 09:07:50,190 [l0-8] DEBUG AppBase - [builtinApplication.DeleteOldSelection] No public zero-argument method named '_DeleteOldSelection' found, performing generic datasource operation
      === 2012-01-06 09:07:50,191 [l0-8] INFO  SQLDataSource - [builtinApplication.DeleteOldSelection] Performing remove operation with
      	criteria: {SaasCustomer_id:1}	values: {SaasCustomer_id:1}
      === 2012-01-06 09:07:50,195 [l0-6] DEBUG RPCManager - Processing 1 requests.
      === 2012-01-06 09:07:50,197 [l0-6] DEBUG RPCManager - Request #1 (DSRequest) payload: {
          criteria:{
              students_id:17
          },
          values:{
              startDate:new Date(1305151200000),
              phone:"061",
              cb1_POK_graduationdate:new Date(1321225200000),
              sofinummer:"123123",
              street:"a",
              surname:"Student4",
              endDate:new Date(1318370400000),
              city:"a",
              Student_id:4,
              cb1_POK_startDate_2:new Date(1324681200000),
              cb1_POK_startDate_1:new Date(1324422000000),
              voorletter:"x",
              archived:false,
              cb1_POK_checkbox_1_1:true,
              cellphone:"061",
              birthdate:new Date(1306188000000),
              cb1_OO_agreement_2:"",
              cb1_POK_checkbox_1_3:true,
              gender:"man",
              cb1_POK_checkbox_1_4:true,
              cb1_POK_endDate_1:new Date(1324508400000),
              published:true,
              cb1_POK_endDate_2:new Date(1324594800000),
              waitinglist:false,
              number_addition:"3",
              cb1_POK_checkbox_2_1:true,
              editionName:"Zomerkwartaal",
              students_id:17,
              cb2_planned_thesis_date:new Date(1321225200000),
              cb1_POK_checkbox_2_2:true,
              cb1_POK_checkbox_2_3:true,
              tussenvoegsel:"z",
              cb1_POK_checkbox_2_4:true,
              cancelled:false,
              number:1,
              firstname:"Student4",
              postcode:"1234ab",
              country:"b",
              lmsAccess:false,
              Status:"definitief",
              birthplace:"s",
              email:"marten@sytematic.nl",
              Course_id:1,
              checkbox:false,
              active:true,
              cb2_defense_date:new Date(1321225200000),
              userAccount:0,
              CourseEdition_id:1,
              cb1_POK_agreement_1:null,
              cb1_POK_agreement_2:null,
              cb1_OO_agreement_1:null
          },
          operationConfig:{
              dataSource:"CourseEdition_students_Student",
              operationType:"update"
          },
          componentId:"isc_ValuesManager_0",
          appID:"builtinApplication",
          operation:"CourseEdition_students_Student_update",
          oldValues:{
              startDate:new Date(1305151200000),
              phone:"061",
              cb1_POK_graduationdate:new Date(1321225200000),
              sofinummer:"123123",
              street:"a",
              surname:"Student4",
              endDate:new Date(1318370400000),
              city:"a",
              Student_id:4,
              cb1_POK_startDate_2:new Date(1324681200000),
              cb1_POK_startDate_1:new Date(1324422000000),
              voorletter:"x",
              archived:false,
              cb1_POK_checkbox_1_1:true,
              cellphone:"061",
              birthdate:new Date(1306188000000),
              cb1_OO_agreement_2:"",
              cb1_POK_checkbox_1_3:true,
              gender:"man",
              cb1_POK_checkbox_1_4:true,
              cb1_POK_endDate_1:new Date(1324508400000),
              published:true,
              cb1_POK_endDate_2:new Date(1324594800000),
              waitinglist:false,
              number_addition:"3",
              cb1_POK_checkbox_2_1:true,
              editionName:"Zomerkwartaal",
              students_id:17,
              cb2_planned_thesis_date:new Date(1321225200000),
              cb1_POK_checkbox_2_2:true,
              cb1_POK_checkbox_2_3:true,
              tussenvoegsel:"z",
              cb1_POK_checkbox_2_4:true,
              cancelled:false,
              number:1,
              firstname:"Student4",
              postcode:"1234ab",
              country:"b",
              lmsAccess:false,
              Status:"definitief",
              birthplace:"s",
              email:"marten@sytematic.nl",
              Course_id:1,
              checkbox:false,
              active:true,
              cb2_defense_date:new Date(1321225200000),
              userAccount:0,
              CourseEdition_id:1,
              cb1_POK_agreement_1:null,
              cb1_POK_agreement_2:null,
              cb1_OO_agreement_1:null
          }
      }
      === 2012-01-06 09:07:50,217 [l0-6] DEBUG AppBase - [builtinApplication.CourseEdition_students_Student_update] No userTypes defined, allowing anyone access to all operations for this application
      === 2012-01-06 09:07:50,218 [l0-6] DEBUG AppBase - [builtinApplication.CourseEdition_students_Student_update] No public zero-argument method named '_CourseEdition_students_Student_update' found, performing generic datasource operation
      === 2012-01-06 09:07:50,219 [l0-6] WARN  Validation - [builtinApplication.CourseEdition_students_Student_update] No such type 'image', not processing field value at /CourseEdition_students_Student/cb1_OO_agreement_2
      === 2012-01-06 09:07:50,220 [l0-6] INFO  SQLDataSource - [builtinApplication.CourseEdition_students_Student_update] Performing update operation with
      	criteria: {students_id:17}	values: {startDate:new Date(1305151200000),phone:"061",cb1_POK_graduationdate:new Date(1321225200000),sofinummer:"123123",street:"a",surname:"Student4",endDate:new Date(1318370400000),city:"a",Student_id:4,cb1_POK_startDate_2:new Date(1324681200000),cb1_POK_startDate_1:new Date(1324422000000),voorletter:"x",archived:false,cb1_POK_checkbox_1_1:true,cellphone:"061",birthdate:new Date(1306188000000),cb1_OO_agreement_2:"",cb1_POK_checkbox_1_3:true,gender:"man",cb1_POK_checkbox_1_4:true,cb1_POK_endDate_1:new Date(1324508400000),published:true,cb1_POK_endDate_2:new Date(1324594800000),waitinglist:false,number_addition:"3",cb1_POK_checkbox_2_1:true,editionName:"Zomerkwartaal",students_id:17,cb2_planned_thesis_date:new Date(1321225200000),cb1_POK_checkbox_2_2:true,cb1_POK_checkbox_2_3:true,tussenvoegsel:"z",cb1_POK_checkbox_2_4:true,cancelled:false,number:1,firstname:"Student4",postcode:"1234ab",country:"b",lmsAccess:false,Status:"definitief",birthplace:"s",email:"marten@sytematic.nl",Course_id:"1",checkbox:false,active:true,cb2_defense_date:new Date(1321225200000),userAccount:"0",CourseEdition_id:1,cb1_POK_agreement_1:null,cb1_POK_agreement_2:null,cb1_OO_agreement_1:null,SaasCustomer_id:1}
      === 2012-01-06 09:07:50,220 [l0-6] INFO  SQLValuesClause - [builtinApplication.CourseEdition_students_Student_update] Ignored data for non-existent or included columns: [SaasCustomer_id]
      === 2012-01-06 09:07:50,302 [l0-8] DEBUG PoolableSQLConnectionFactory - [builtinApplication.DeleteOldSelection] Returning pooled Connection
      === 2012-01-06 09:07:50,310 [l0-8] DEBUG SQLTransaction - [builtinApplication.DeleteOldSelection] Started new Mysql transaction "1572565511"
      === 2012-01-06 09:07:50,310 [l0-8] INFO  SQLDriver - [builtinApplication.DeleteOldSelection] Executing SQL update on 'Mysql': DELETE FROM CourseOptionSelection WHERE students_id=$values.students_id
      === 2012-01-06 09:07:50,311 [l0-8] WARN  RequestContext - dsRequest.execute() failed: 
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '$values.students_id' in 'where clause'
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
      	at com.mysql.jdbc.Util.getInstance(Util.java:381)
      	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1051)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)
      	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)
      	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
      	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
      	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)
      	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2395)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2313)
      	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2298)
      	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
      	at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:528)
      	at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:482)
      	at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:602)
      	at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:403)
      	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1368)
      	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:293)
      	at com.isomorphic.sql.SQLDataSource.executeRemove(SQLDataSource.java:249)
      	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1291)
      	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
      	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
      	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
      	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1948)
      	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
      	at nl.sytematic.projects.Technicom.server.security.SecureIDACall.processRequest(SecureIDACall.java:124)
      	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
      	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
      	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at nl.sytematic.projects.Technicom.server.security.SytematicConcurrentSessionFilter.doFilter(SytematicConcurrentSessionFilter.java:62)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
      	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
      	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
      	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
      Last edited by Sytematic; 6 Jan 2012, 00:23.

      Comment


        #4
        For safety reasons, and also because there would be no way to properly update caches, the client doesn't allow a delete without the primary key.

        The best way to do this is: it looks like you're doing a delete and re-add. On way to do this would be to just do the add operation, then use dsRequest.addRelatedUpdates() to list out all the deleted records. This would update cache properly.

        Comment


          #5
          Originally posted by Isomorphic
          ... it looks like you're doing a delete and re-add ...
          Exactly, I have to remove all the old rows of this student, and then add new ones he selected.

          However I kind of miss your hint. I now implemented it by first getting a list of all the primary keys to remove, involving one extra fetch, but since i am queueing the requests for the add and delete, it's still only one more round trip to the server.

          Of course, now, on the server, there are potentially about 4-5 DELETE queries done extra. For now, this is fine (i'm under deadline, so now it atleast works).
          Yet I am still curious about the best way to implement this.

          Q1. Is your method using a Custom DMI add method that does the delete afterwards? I couldn't find the method you said on the API in the docs.


          Q2. Another question: I am now grouping all the adds from the client in one request using Queueing by the RPCManager, but on the server this ends up in a few separate add queries. Is it also possible to send it in one big Add query (ie. directly from the client, I know how to do it from the server in DMI)? Should I then group the data in a List of Maps on the client side, will that be sufficient?
          Last edited by Sytematic; 7 Jan 2012, 00:04.

          Comment


            #6
            The method dsResponse.addRelatedUpdates() in a server-side method. Yes the suggestion is to write a DMI that does the deletes as a consequence of the "add".

            You do not actually need to do the deletes individually, you can do them as a single dsRequest - you are initiating the dsRequest from server code, so it will not be constrained to deletion by primary key.

            However in order to communicate to the client system which records were removed, you would need to do a single "fetch" dsRequest to find the list of records that will be deleted, so you can form a series of "remove" DSResponses to send back to the client via addRelatedUpdates.

            Comment

            Working...
            X