Announcement

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

    Unique validator bug

    Hi Isomorphic,

    please take a look at this one. Title of the window contains my current smartGWT version, but this is also happening in 11.1.

    Click image for larger version

Name:	validator_isUnique_bug.gif
Views:	83
Size:	55.8 KB
ID:	255230

    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.Version;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.AdvancedCriteria;
    import com.smartgwt.client.data.Criterion;
    import com.smartgwt.client.types.OperatorId;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.Button;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS extends VLayout implements EntryPoint {
        private IButton recreateBtn;
    
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
    
            setWidth100();
            setHeight100();
    
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    new MyWindow().show();
                }
            });
            addMember(recreateBtn);
            new MyWindow().show();
            draw();
        }
    
        private class MyWindow extends Window {
    
            public MyWindow() {
                setWidth(800);
                setHeight(600);
                setMembersMargin(0);
                setModalMaskOpacity(70);
                setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                SC.logWarn(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                setShowMinimizeButton(false);
                setIsModal(true);
                setShowModalMask(true);
                centerInPage();
    
                final CustomDF mainLG = new CustomDF();
                Button saveButton = new Button("Save");
                saveButton.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        mainLG.validate();
                    }
                });
    
                addItem(mainLG);
                addItem(saveButton);
            }
    
            private class CustomDF extends DynamicForm {
                public CustomDF() {
                    setDataSource("animals");
    
                    TextItem ti = new TextItem("commonName");
                    setFields(ti);
    
                    fetchData(new AdvancedCriteria(new Criterion("commonName", OperatorId.STARTS_WITH, "El")));
                }
            }
        }
    }
    Code:
            <field name="commonName"      title="Animal"             type="text">
                <validators>
                    <validator type="isUnique" serverOnly="true">
                        <errorMessage>Name is already in use.</errorMessage>
                    </validator>
                </validators>
            </field>
    As it is written in docs, caseSensitive="false" by default, so IMHO this should work.

    Best regards
    Pavo

    #2
    This works good, sorry, my mistake. I have another problem that this test case does not show. I'll post it here, later.

    Comment


      #3
      Hi Isomorphic,

      please take a look at this.

      Click image for larger version  Name:	validator_isUnique_update_after_error.gif Views:	1 Size:	86.3 KB ID:	255237

      Code:
      === 2018-09-25 14:53:24,416 [ec-3] INFO  LMSIDACall - Performing 2 operation(s)
      === 2018-09-25 14:53:24,417 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_validate] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,417 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_validate] No public zero-argument method named '_T_CAMPAIGN_validate' found, performing generic datasource operation
      === 2018-09-25 14:53:24,422 [ec-3] DEBUG ServerObject - [builtinApplication.T_CAMPAIGN_validate] Couldn't find a public method named: fetch on class: com.lmscompany.lms.server.worker.T_CAMPAIGN
      === 2018-09-25 14:53:24,422 [ec-3] DEBUG DataSourceDMI - [builtinApplication.T_CAMPAIGN_validate] DataSourceDMI: no public method name: fetch available on class: com.lmscompany.lms.server.worker.T_CAMPAIGN - defaulting to builtin operations.
      === 2018-09-25 14:53:24,422 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,423 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
      === 2018-09-25 14:53:24,423 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] Performing fetch operation with
          outputs: [ID, NAME]    criteria: {TENANT_ID:1,NAME:"messe Cebit 2017"}    values: {TENANT_ID:1,NAME:"messe Cebit 2017"}
      === 2018-09-25 14:53:24,423 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
      === 2018-09-25 14:53:24,423 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] 2662: Executing SQL query on 'Oracle': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.NAME FROM T_CAMPAIGN WHERE (T_CAMPAIGN.TENANT_ID=1 AND LOWER(T_CAMPAIGN.NAME)='messe cebit 2017')
      === 2018-09-25 14:53:24,424 [ec-3] DEBUG SQLTransaction - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] Started new Oracle transaction "1613788807"
      === 2018-09-25 14:53:24,424 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] Setting DSRequest as being part of a transaction
      === 2018-09-25 14:53:24,424 [ec-3] INFO  SQLDriver - [builtinApplication.T_CAMPAIGN_validate, builtinApplication.null] Executing SQL query on 'Oracle' using connection '1613788807': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.NAME FROM T_CAMPAIGN WHERE (T_CAMPAIGN.TENANT_ID=1 AND LOWER(T_CAMPAIGN.NAME)='messe cebit 2017')
      === 2018-09-25 14:53:24,424 [ec-3] INFO  DSResponse - [builtinApplication.T_CAMPAIGN_validate] DSResponse: List with 1 items
      === 2018-09-25 14:53:24,426 [ec-3] DEBUG DefaultValidators - [builtinApplication.T_CAMPAIGN_validate] unique check: pkField: ID, old PK: 15, new PK: 15
      === 2018-09-25 14:53:24,426 [ec-3] DEBUG DefaultValidators - [builtinApplication.T_CAMPAIGN_validate] unique check: unique field: NAME, old unique value: Messe Cebit 2017, new unique value: messe Cebit 2017
      [B]=== 2018-09-25 14:53:24,426 [ec-3] DEBUG ValidationContext - [builtinApplication.T_CAMPAIGN_validate] Adding validation errors at path '/T_CAMPAIGN/NAME/NAME': {errorMessage=Der Name wird bereits verwendet!}
      === 2018-09-25 14:53:24,426 [ec-3] INFO  Validation - [builtinApplication.T_CAMPAIGN_validate] Validation error: [
          {
              NAME:{
                  errorMessage:"Der Name wird bereits verwendet!"
              }
          }
      ][/B]
      === 2018-09-25 14:53:24,430 [ec-3] DEBUG ServerObject - Couldn't find a public method named: fetch on class: com.lmscompany.lms.server.worker.T_CAMPAIGN
      === 2018-09-25 14:53:24,430 [ec-3] DEBUG DataSourceDMI - DataSourceDMI: no public method name: fetch available on class: com.lmscompany.lms.server.worker.T_CAMPAIGN - defaulting to builtin operations.
      === 2018-09-25 14:53:24,430 [ec-3] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,430 [ec-3] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
      === 2018-09-25 14:53:24,430 [ec-3] INFO  SQLDataSource - [builtinApplication.null] Performing fetch operation with
          criteria: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"TENANT_ID",value:1,operator:"equals"},{fieldName:"ID",value:15,operator:"equals"},{fieldName:"CREATED_BY_TENANT_ID",value:1,operator:"equals"},{fieldName:"MODIFIED_BY_TENANT_ID",value:1,operator:"equals"}],operator:"and"}    values: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"TENANT_ID",value:1,operator:"equals"},{fieldName:"ID",value:15,operator:"equals"},{fieldName:"CREATED_BY_TENANT_ID",value:1,operator:"equals"},{fieldName:"MODIFIED_BY_TENANT_ID",value:1,operator:"equals"}],operator:"and"}
      === 2018-09-25 14:53:24,431 [ec-3] INFO  SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause$defaultAnsiJoinClause WHERE $defaultWhereClause
      === 2018-09-25 14:53:24,431 [ec-3] INFO  SQLDataSource - [builtinApplication.null] 3689: Executing SQL query on 'Oracle': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.TENANT_ID, T_CAMPAIGN.CREATED_BY, T_CAMPAIGN.CREATED_AT, T_CAMPAIGN.MODIFIED_BY, T_CAMPAIGN.MODIFIED_AT, T_CAMPAIGN.SHORTNAME, T_CAMPAIGN.NAME, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'NAME', 'en') AS NAME_TRANSLATED, T_CAMPAIGN.DESCRIPTION, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'DESCRIPTION', 'en') AS DESCRIPTION_TRANSLATED, T_CAMPAIGN.CAMPAIGN_COMMENT, T_CAMPAIGN.STARTDATE, T_CAMPAIGN.ENDDATE, T_CAMPAIGN.COST, T_CAMPAIGN.COMPANYDEFAULT, T_CAMPAIGN.DISTRIBUTORDEFAULT, T_CAMPAIGN.RESELLERDEFAULT, USER_CREATED_BY.GENDER_SHORTNAME AS CREATED_BY_GENDER_SHORTNAME, USER_CREATED_BY.GIVENNAME AS CREATED_BY_GIVENNAME, USER_CREATED_BY.SURNAME AS CREATED_BY_SURNAME, USER_CREATED_BY.FULLNAME_INITIALS_GIVENNAME AS CREATED_BY_NAME, USER_CREATED_BY.FULLNAME AS CREATED_BY_FULLNAME, USER_CREATED_BY.FULLNAME_LEGALENTITYNAME AS CREATED_BY_NAME_TOOLTIP, USER_CREATED_BY.LEGALENTITYNAME AS CREATED_BY_LEGALENTITYNAME, USER_CREATED_BY.EMAIL_USE AS CREATED_BY_EMAIL, USER_CREATED_BY.EMAILENTRY_USE AS CREATED_BY_EMAILENTRY, USER_MODIFIED_BY.FULLNAME_INITIALS_GIVENNAME AS MODIFIED_BY_NAME, USER_MODIFIED_BY.FULLNAME_LEGALENTITYNAME AS MODIFIED_BY_NAME_TOOLTIP, USER_MODIFIED_BY.LEGALENTITYNAME AS MODIFIED_BY_LEGALENTITYNAME, USER_CREATED_BY.BELONGSTO_COMPANY_ID AS CREATED_BY_COMPANY_ID, USER_CREATED_BY.BELONGSTO_DISTRIBUTOR_ID AS CREATED_BY_DISTRIBUTOR_ID, USER_CREATED_BY.BELONGSTO_RESELLER_ID AS CREATED_BY_RESELLER_ID, USER_CREATED_BY.TENANT_ID AS CREATED_BY_TENANT_ID, USER_MODIFIED_BY.TENANT_ID AS MODIFIED_BY_TENANT_ID FROM T_CAMPAIGN JOIN V_USER_DATA USER_CREATED_BY ON T_CAMPAIGN.CREATED_BY = USER_CREATED_BY.ID JOIN V_USER_DATA USER_MODIFIED_BY ON T_CAMPAIGN.MODIFIED_BY = USER_MODIFIED_BY.ID WHERE ((T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL) AND (T_CAMPAIGN.ID = 15 AND T_CAMPAIGN.ID IS NOT NULL) AND (USER_CREATED_BY.TENANT_ID = 1 AND USER_CREATED_BY.TENANT_ID IS NOT NULL) AND (USER_MODIFIED_BY.TENANT_ID = 1 AND USER_MODIFIED_BY.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,431 [ec-3] DEBUG SQLDataSource - [builtinApplication.null] Setting DSRequest as being part of a transaction
      === 2018-09-25 14:53:24,431 [ec-3] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '1613788807': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.TENANT_ID, T_CAMPAIGN.CREATED_BY, T_CAMPAIGN.CREATED_AT, T_CAMPAIGN.MODIFIED_BY, T_CAMPAIGN.MODIFIED_AT, T_CAMPAIGN.SHORTNAME, T_CAMPAIGN.NAME, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'NAME', 'en') AS NAME_TRANSLATED, T_CAMPAIGN.DESCRIPTION, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'DESCRIPTION', 'en') AS DESCRIPTION_TRANSLATED, T_CAMPAIGN.CAMPAIGN_COMMENT, T_CAMPAIGN.STARTDATE, T_CAMPAIGN.ENDDATE, T_CAMPAIGN.COST, T_CAMPAIGN.COMPANYDEFAULT, T_CAMPAIGN.DISTRIBUTORDEFAULT, T_CAMPAIGN.RESELLERDEFAULT, USER_CREATED_BY.GENDER_SHORTNAME AS CREATED_BY_GENDER_SHORTNAME, USER_CREATED_BY.GIVENNAME AS CREATED_BY_GIVENNAME, USER_CREATED_BY.SURNAME AS CREATED_BY_SURNAME, USER_CREATED_BY.FULLNAME_INITIALS_GIVENNAME AS CREATED_BY_NAME, USER_CREATED_BY.FULLNAME AS CREATED_BY_FULLNAME, USER_CREATED_BY.FULLNAME_LEGALENTITYNAME AS CREATED_BY_NAME_TOOLTIP, USER_CREATED_BY.LEGALENTITYNAME AS CREATED_BY_LEGALENTITYNAME, USER_CREATED_BY.EMAIL_USE AS CREATED_BY_EMAIL, USER_CREATED_BY.EMAILENTRY_USE AS CREATED_BY_EMAILENTRY, USER_MODIFIED_BY.FULLNAME_INITIALS_GIVENNAME AS MODIFIED_BY_NAME, USER_MODIFIED_BY.FULLNAME_LEGALENTITYNAME AS MODIFIED_BY_NAME_TOOLTIP, USER_MODIFIED_BY.LEGALENTITYNAME AS MODIFIED_BY_LEGALENTITYNAME, USER_CREATED_BY.BELONGSTO_COMPANY_ID AS CREATED_BY_COMPANY_ID, USER_CREATED_BY.BELONGSTO_DISTRIBUTOR_ID AS CREATED_BY_DISTRIBUTOR_ID, USER_CREATED_BY.BELONGSTO_RESELLER_ID AS CREATED_BY_RESELLER_ID, USER_CREATED_BY.TENANT_ID AS CREATED_BY_TENANT_ID, USER_MODIFIED_BY.TENANT_ID AS MODIFIED_BY_TENANT_ID FROM T_CAMPAIGN JOIN V_USER_DATA USER_CREATED_BY ON T_CAMPAIGN.CREATED_BY = USER_CREATED_BY.ID JOIN V_USER_DATA USER_MODIFIED_BY ON T_CAMPAIGN.MODIFIED_BY = USER_MODIFIED_BY.ID WHERE ((T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL) AND (T_CAMPAIGN.ID = 15 AND T_CAMPAIGN.ID IS NOT NULL) AND (USER_CREATED_BY.TENANT_ID = 1 AND USER_CREATED_BY.TENANT_ID IS NOT NULL) AND (USER_MODIFIED_BY.TENANT_ID = 1 AND USER_MODIFIED_BY.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,451 [ec-3] INFO  DSResponse - DSResponse: List with 1 items
      === 2018-09-25 14:53:24,452 [ec-3] DEBUG ServerObject - Couldn't find a public method named: fetch on class: com.lmscompany.lms.server.worker.T_CAMPAIGN
      === 2018-09-25 14:53:24,452 [ec-3] DEBUG DataSourceDMI - DataSourceDMI: no public method name: fetch available on class: com.lmscompany.lms.server.worker.T_CAMPAIGN - defaulting to builtin operations.
      === 2018-09-25 14:53:24,452 [ec-3] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,452 [ec-3] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
      === 2018-09-25 14:53:24,453 [ec-3] INFO  SQLDataSource - [builtinApplication.null] Performing fetch operation with
          outputs: [ID, NAME]    criteria: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"NAME",value:"messe Cebit 2017",operator:"iEquals"},{criteria:[{fieldName:"ID",value:15,operator:"notEqual"}],operator:"or"},{fieldName:"TENANT_ID",value:1,operator:"equals"}],operator:"and"}    values: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"NAME",value:"messe Cebit 2017",operator:"iEquals"},{criteria:[{fieldName:"ID",value:15,operator:"notEqual"}],operator:"or"},{fieldName:"TENANT_ID",value:1,operator:"equals"}],operator:"and"}
      === 2018-09-25 14:53:24,453 [ec-3] INFO  SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
      === 2018-09-25 14:53:24,453 [ec-3] INFO  SQLDataSource - [builtinApplication.null] 2662: Executing SQL query on 'Oracle': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.NAME FROM T_CAMPAIGN WHERE ((LOWER(T_CAMPAIGN.NAME) = LOWER('messe cebit 2017') AND T_CAMPAIGN.NAME IS NOT NULL) AND ((T_CAMPAIGN.ID <> 15 OR T_CAMPAIGN.ID IS NULL)) AND (T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,453 [ec-3] DEBUG SQLDataSource - [builtinApplication.null] Setting DSRequest as being part of a transaction
      === 2018-09-25 14:53:24,453 [ec-3] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '1613788807': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.NAME FROM T_CAMPAIGN WHERE ((LOWER(T_CAMPAIGN.NAME) = LOWER('messe cebit 2017') AND T_CAMPAIGN.NAME IS NOT NULL) AND ((T_CAMPAIGN.ID <> 15 OR T_CAMPAIGN.ID IS NULL)) AND (T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,453 [ec-3] INFO  DSResponse - DSResponse: List with 0 items
      === 2018-09-25 14:53:24,458 [ec-3] DEBUG ServerObject - Couldn't find a public method named: fetch on class: com.lmscompany.lms.server.worker.T_CAMPAIGN
      === 2018-09-25 14:53:24,458 [ec-3] DEBUG DataSourceDMI - DataSourceDMI: no public method name: fetch available on class: com.lmscompany.lms.server.worker.T_CAMPAIGN - defaulting to builtin operations.
      === 2018-09-25 14:53:24,458 [ec-3] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,458 [ec-3] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
      === 2018-09-25 14:53:24,459 [ec-3] INFO  SQLDataSource - [builtinApplication.null] Performing fetch operation with
          criteria: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"TENANT_ID",value:1,operator:"equals"},{fieldName:"ID",value:15,operator:"equals"},{fieldName:"CREATED_BY_TENANT_ID",value:1,operator:"equals"},{fieldName:"MODIFIED_BY_TENANT_ID",value:1,operator:"equals"}],operator:"and"}    values: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"TENANT_ID",value:1,operator:"equals"},{fieldName:"ID",value:15,operator:"equals"},{fieldName:"CREATED_BY_TENANT_ID",value:1,operator:"equals"},{fieldName:"MODIFIED_BY_TENANT_ID",value:1,operator:"equals"}],operator:"and"}
      === 2018-09-25 14:53:24,460 [ec-3] INFO  SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause$defaultAnsiJoinClause WHERE $defaultWhereClause
      === 2018-09-25 14:53:24,460 [ec-3] INFO  SQLDataSource - [builtinApplication.null] 3693: Executing SQL query on 'Oracle': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.TENANT_ID, T_CAMPAIGN.CREATED_BY, T_CAMPAIGN.CREATED_AT, T_CAMPAIGN.MODIFIED_BY, T_CAMPAIGN.MODIFIED_AT, T_CAMPAIGN.SHORTNAME, T_CAMPAIGN.NAME, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'NAME', 'en') AS NAME_TRANSLATED, T_CAMPAIGN.DESCRIPTION, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'DESCRIPTION', 'en') AS DESCRIPTION_TRANSLATED, T_CAMPAIGN.CAMPAIGN_COMMENT, T_CAMPAIGN.STARTDATE, T_CAMPAIGN.ENDDATE, T_CAMPAIGN.COST, T_CAMPAIGN.COMPANYDEFAULT, T_CAMPAIGN.DISTRIBUTORDEFAULT, T_CAMPAIGN.RESELLERDEFAULT, USER_CREATED_BY.GENDER_SHORTNAME AS CREATED_BY_GENDER_SHORTNAME, USER_CREATED_BY.GIVENNAME AS CREATED_BY_GIVENNAME, USER_CREATED_BY.SURNAME AS CREATED_BY_SURNAME, USER_CREATED_BY.FULLNAME_INITIALS_GIVENNAME AS CREATED_BY_NAME, USER_CREATED_BY.FULLNAME AS CREATED_BY_FULLNAME, USER_CREATED_BY.FULLNAME_LEGALENTITYNAME AS CREATED_BY_NAME_TOOLTIP, USER_CREATED_BY.LEGALENTITYNAME AS CREATED_BY_LEGALENTITYNAME, USER_CREATED_BY.EMAIL_USE AS CREATED_BY_EMAIL, USER_CREATED_BY.EMAILENTRY_USE AS CREATED_BY_EMAILENTRY, USER_MODIFIED_BY.FULLNAME_INITIALS_GIVENNAME AS MODIFIED_BY_NAME, USER_MODIFIED_BY.FULLNAME_LEGALENTITYNAME AS MODIFIED_BY_NAME_TOOLTIP, USER_MODIFIED_BY.LEGALENTITYNAME AS MODIFIED_BY_LEGALENTITYNAME, USER_CREATED_BY.BELONGSTO_COMPANY_ID AS CREATED_BY_COMPANY_ID, USER_CREATED_BY.BELONGSTO_DISTRIBUTOR_ID AS CREATED_BY_DISTRIBUTOR_ID, USER_CREATED_BY.BELONGSTO_RESELLER_ID AS CREATED_BY_RESELLER_ID, USER_CREATED_BY.TENANT_ID AS CREATED_BY_TENANT_ID, USER_MODIFIED_BY.TENANT_ID AS MODIFIED_BY_TENANT_ID FROM T_CAMPAIGN JOIN V_USER_DATA USER_CREATED_BY ON T_CAMPAIGN.CREATED_BY = USER_CREATED_BY.ID JOIN V_USER_DATA USER_MODIFIED_BY ON T_CAMPAIGN.MODIFIED_BY = USER_MODIFIED_BY.ID WHERE ((T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL) AND (T_CAMPAIGN.ID = 15 AND T_CAMPAIGN.ID IS NOT NULL) AND (USER_CREATED_BY.TENANT_ID = 1 AND USER_CREATED_BY.TENANT_ID IS NOT NULL) AND (USER_MODIFIED_BY.TENANT_ID = 1 AND USER_MODIFIED_BY.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,460 [ec-3] DEBUG SQLDataSource - [builtinApplication.null] Setting DSRequest as being part of a transaction
      === 2018-09-25 14:53:24,460 [ec-3] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '1613788807': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.TENANT_ID, T_CAMPAIGN.CREATED_BY, T_CAMPAIGN.CREATED_AT, T_CAMPAIGN.MODIFIED_BY, T_CAMPAIGN.MODIFIED_AT, T_CAMPAIGN.SHORTNAME, T_CAMPAIGN.NAME, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'NAME', 'en') AS NAME_TRANSLATED, T_CAMPAIGN.DESCRIPTION, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'DESCRIPTION', 'en') AS DESCRIPTION_TRANSLATED, T_CAMPAIGN.CAMPAIGN_COMMENT, T_CAMPAIGN.STARTDATE, T_CAMPAIGN.ENDDATE, T_CAMPAIGN.COST, T_CAMPAIGN.COMPANYDEFAULT, T_CAMPAIGN.DISTRIBUTORDEFAULT, T_CAMPAIGN.RESELLERDEFAULT, USER_CREATED_BY.GENDER_SHORTNAME AS CREATED_BY_GENDER_SHORTNAME, USER_CREATED_BY.GIVENNAME AS CREATED_BY_GIVENNAME, USER_CREATED_BY.SURNAME AS CREATED_BY_SURNAME, USER_CREATED_BY.FULLNAME_INITIALS_GIVENNAME AS CREATED_BY_NAME, USER_CREATED_BY.FULLNAME AS CREATED_BY_FULLNAME, USER_CREATED_BY.FULLNAME_LEGALENTITYNAME AS CREATED_BY_NAME_TOOLTIP, USER_CREATED_BY.LEGALENTITYNAME AS CREATED_BY_LEGALENTITYNAME, USER_CREATED_BY.EMAIL_USE AS CREATED_BY_EMAIL, USER_CREATED_BY.EMAILENTRY_USE AS CREATED_BY_EMAILENTRY, USER_MODIFIED_BY.FULLNAME_INITIALS_GIVENNAME AS MODIFIED_BY_NAME, USER_MODIFIED_BY.FULLNAME_LEGALENTITYNAME AS MODIFIED_BY_NAME_TOOLTIP, USER_MODIFIED_BY.LEGALENTITYNAME AS MODIFIED_BY_LEGALENTITYNAME, USER_CREATED_BY.BELONGSTO_COMPANY_ID AS CREATED_BY_COMPANY_ID, USER_CREATED_BY.BELONGSTO_DISTRIBUTOR_ID AS CREATED_BY_DISTRIBUTOR_ID, USER_CREATED_BY.BELONGSTO_RESELLER_ID AS CREATED_BY_RESELLER_ID, USER_CREATED_BY.TENANT_ID AS CREATED_BY_TENANT_ID, USER_MODIFIED_BY.TENANT_ID AS MODIFIED_BY_TENANT_ID FROM T_CAMPAIGN JOIN V_USER_DATA USER_CREATED_BY ON T_CAMPAIGN.CREATED_BY = USER_CREATED_BY.ID JOIN V_USER_DATA USER_MODIFIED_BY ON T_CAMPAIGN.MODIFIED_BY = USER_MODIFIED_BY.ID WHERE ((T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL) AND (T_CAMPAIGN.ID = 15 AND T_CAMPAIGN.ID IS NOT NULL) AND (USER_CREATED_BY.TENANT_ID = 1 AND USER_CREATED_BY.TENANT_ID IS NOT NULL) AND (USER_MODIFIED_BY.TENANT_ID = 1 AND USER_MODIFIED_BY.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,461 [ec-3] INFO  DSResponse - DSResponse: List with 1 items
      === 2018-09-25 14:53:24,463 [ec-3] DEBUG ServerObject - Couldn't find a public method named: fetch on class: com.lmscompany.lms.server.worker.T_CAMPAIGN
      === 2018-09-25 14:53:24,463 [ec-3] DEBUG DataSourceDMI - DataSourceDMI: no public method name: fetch available on class: com.lmscompany.lms.server.worker.T_CAMPAIGN - defaulting to builtin operations.
      === 2018-09-25 14:53:24,463 [ec-3] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,463 [ec-3] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
      === 2018-09-25 14:53:24,463 [ec-3] INFO  SQLDataSource - [builtinApplication.null] Performing fetch operation with
          outputs: [ID, NAME]    criteria: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"NAME",value:"messe Cebit 2017",operator:"iEquals"},{criteria:[{fieldName:"ID",value:15,operator:"notEqual"}],operator:"or"},{fieldName:"TENANT_ID",value:1,operator:"equals"}],operator:"and"}    values: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"NAME",value:"messe Cebit 2017",operator:"iEquals"},{criteria:[{fieldName:"ID",value:15,operator:"notEqual"}],operator:"or"},{fieldName:"TENANT_ID",value:1,operator:"equals"}],operator:"and"}
      === 2018-09-25 14:53:24,464 [ec-3] INFO  SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
      === 2018-09-25 14:53:24,464 [ec-3] INFO  SQLDataSource - [builtinApplication.null] 2662: Executing SQL query on 'Oracle': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.NAME FROM T_CAMPAIGN WHERE ((LOWER(T_CAMPAIGN.NAME) = LOWER('messe cebit 2017') AND T_CAMPAIGN.NAME IS NOT NULL) AND ((T_CAMPAIGN.ID <> 15 OR T_CAMPAIGN.ID IS NULL)) AND (T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,464 [ec-3] DEBUG SQLDataSource - [builtinApplication.null] Setting DSRequest as being part of a transaction
      === 2018-09-25 14:53:24,464 [ec-3] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '1613788807': SELECT T_CAMPAIGN.ID, T_CAMPAIGN.NAME FROM T_CAMPAIGN WHERE ((LOWER(T_CAMPAIGN.NAME) = LOWER('messe cebit 2017') AND T_CAMPAIGN.NAME IS NOT NULL) AND ((T_CAMPAIGN.ID <> 15 OR T_CAMPAIGN.ID IS NULL)) AND (T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,464 [ec-3] INFO  DSResponse - DSResponse: List with 0 items
      === 2018-09-25 14:53:24,465 [ec-3] WARN  DSRequest - setValidatedValues called more than once for this DSRequest object
      === 2018-09-25 14:53:24,465 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_update] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,465 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_update] No public zero-argument method named '_T_CAMPAIGN_update' found, performing generic datasource operation
      === 2018-09-25 14:53:24,465 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_update] Performing update operation with
          criteria: {TENANT_ID:1,ID:15}    values: {MODIFIED_BY:"1",STARTDATE:new Date(1488322800000),NAME_TRANSLATED:"Messe Cebit 2017",CREATED_BY_GENDER_SHORTNAME:"?",ID:15,CREATED_BY_TENANT_ID:1,MODIFIED_AT:new Date(1537880004417),MODIFIED_BY_TENANT_ID:1,SHORTNAME:"Messe Cebit 2017",CREATED_BY_COMPANY_ID:1,COMPANYDEFAULT:false,DISTRIBUTORDEFAULT:false,NAME:"messe Cebit 2017",TENANT_ID:1,RESELLERDEFAULT:false}
      === 2018-09-25 14:53:24,465 [ec-3] INFO  SQLValuesClause - [builtinApplication.T_CAMPAIGN_update] Ignored data for non-existent or included columns: [CREATED_BY_GENDER_SHORTNAME, CREATED_BY_TENANT_ID, MODIFIED_BY_TENANT_ID, CREATED_BY_COMPANY_ID]
      === 2018-09-25 14:53:24,465 [ec-3] INFO  SQLValuesClause - [builtinApplication.T_CAMPAIGN_update] Ignoring value for NAME_TRANSLATED since it has a customSelectExpression or customSQLExpression but no customUpdateExpression
      === 2018-09-25 14:53:24,466 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update] Setting DSRequest as being part of a transaction
      [B]=== 2018-09-25 14:53:24,466 [ec-3] INFO  SQLDriver - [builtinApplication.T_CAMPAIGN_update] Executing SQL query on 'Oracle' using connection '1613788807': [/B][B]UPDATE T_CAMPAIGN SET COMPANYDEFAULT='N', DISTRIBUTORDEFAULT='N', MODIFIED_AT=TO_DATE('2018-09-25 14:53:24','YYYY-MM-DD HH24:MI:SS'), MODIFIED_BY='1', NAME='messe Cebit 2017', RESELLERDEFAULT='N', SHORTNAME='Messe Cebit 2017', STARTDATE=TO_DATE('2017-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS'), TENANT_ID=1 WHERE (T_CAMPAIGN.TENANT_ID=1 AND T_CAMPAIGN.ID=15)[/B]
      === 2018-09-25 14:53:24,467 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_update] primaryKeys: {ID=15}
      === 2018-09-25 14:53:24,467 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update] Gathered all keys.  lastPrimaryKeys is now {ID=15}
      === 2018-09-25 14:53:24,467 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update] update operation affected 1 rows
      === 2018-09-25 14:53:24,468 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_update] Oracle getLastRow(): using default operationBinding
      === 2018-09-25 14:53:24,468 [ec-3] DEBUG ServerObject - [builtinApplication.T_CAMPAIGN_update] Couldn't find a public method named: fetch on class: com.lmscompany.lms.server.worker.T_CAMPAIGN
      === 2018-09-25 14:53:24,468 [ec-3] DEBUG DataSourceDMI - [builtinApplication.T_CAMPAIGN_update] DataSourceDMI: no public method name: fetch available on class: com.lmscompany.lms.server.worker.T_CAMPAIGN - defaulting to builtin operations.
      === 2018-09-25 14:53:24,468 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
      === 2018-09-25 14:53:24,468 [ec-3] DEBUG AppBase - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
      === 2018-09-25 14:53:24,468 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] Performing fetch operation with
          criteria: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"TENANT_ID",value:1,operator:"equals"},{fieldName:"ID",value:15,operator:"equals"},{fieldName:"CREATED_BY_TENANT_ID",value:1,operator:"equals"},{fieldName:"MODIFIED_BY_TENANT_ID",value:1,operator:"equals"}],operator:"and"}    values: {_constructor:"AdvancedCriteria",criteria:[{fieldName:"TENANT_ID",value:1,operator:"equals"},{fieldName:"ID",value:15,operator:"equals"},{fieldName:"CREATED_BY_TENANT_ID",value:1,operator:"equals"},{fieldName:"MODIFIED_BY_TENANT_ID",value:1,operator:"equals"}],operator:"and"}
      === 2018-09-25 14:53:24,469 [ec-3] INFO  SQLDataSource - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause$defaultAnsiJoinClause WHERE $defaultWhereClause
      === 2018-09-25 14:53:24,469 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] JDBC driver windowed select rows 0->-1, result size 1. Query: SELECT T_CAMPAIGN.ID, T_CAMPAIGN.TENANT_ID, T_CAMPAIGN.CREATED_BY, T_CAMPAIGN.CREATED_AT, T_CAMPAIGN.MODIFIED_BY, T_CAMPAIGN.MODIFIED_AT, T_CAMPAIGN.SHORTNAME, T_CAMPAIGN.NAME, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'NAME', 'en') AS NAME_TRANSLATED, T_CAMPAIGN.DESCRIPTION, translation.gettranslation(T_CAMPAIGN.TENANT_ID, 'T_CAMPAIGN', T_CAMPAIGN.ID, 'DESCRIPTION', 'en') AS DESCRIPTION_TRANSLATED, T_CAMPAIGN.CAMPAIGN_COMMENT, T_CAMPAIGN.STARTDATE, T_CAMPAIGN.ENDDATE, T_CAMPAIGN.COST, T_CAMPAIGN.COMPANYDEFAULT, T_CAMPAIGN.DISTRIBUTORDEFAULT, T_CAMPAIGN.RESELLERDEFAULT, USER_CREATED_BY.GENDER_SHORTNAME AS CREATED_BY_GENDER_SHORTNAME, USER_CREATED_BY.GIVENNAME AS CREATED_BY_GIVENNAME, USER_CREATED_BY.SURNAME AS CREATED_BY_SURNAME, USER_CREATED_BY.FULLNAME_INITIALS_GIVENNAME AS CREATED_BY_NAME, USER_CREATED_BY.FULLNAME AS CREATED_BY_FULLNAME, USER_CREATED_BY.FULLNAME_LEGALENTITYNAME AS CREATED_BY_NAME_TOOLTIP, USER_CREATED_BY.LEGALENTITYNAME AS CREATED_BY_LEGALENTITYNAME, USER_CREATED_BY.EMAIL_USE AS CREATED_BY_EMAIL, USER_CREATED_BY.EMAILENTRY_USE AS CREATED_BY_EMAILENTRY, USER_MODIFIED_BY.FULLNAME_INITIALS_GIVENNAME AS MODIFIED_BY_NAME, USER_MODIFIED_BY.FULLNAME_LEGALENTITYNAME AS MODIFIED_BY_NAME_TOOLTIP, USER_MODIFIED_BY.LEGALENTITYNAME AS MODIFIED_BY_LEGALENTITYNAME, USER_CREATED_BY.BELONGSTO_COMPANY_ID AS CREATED_BY_COMPANY_ID, USER_CREATED_BY.BELONGSTO_DISTRIBUTOR_ID AS CREATED_BY_DISTRIBUTOR_ID, USER_CREATED_BY.BELONGSTO_RESELLER_ID AS CREATED_BY_RESELLER_ID, USER_CREATED_BY.TENANT_ID AS CREATED_BY_TENANT_ID, USER_MODIFIED_BY.TENANT_ID AS MODIFIED_BY_TENANT_ID FROM T_CAMPAIGN JOIN V_USER_DATA USER_CREATED_BY ON T_CAMPAIGN.CREATED_BY = USER_CREATED_BY.ID JOIN V_USER_DATA USER_MODIFIED_BY ON T_CAMPAIGN.MODIFIED_BY = USER_MODIFIED_BY.ID WHERE ((T_CAMPAIGN.TENANT_ID = 1 AND T_CAMPAIGN.TENANT_ID IS NOT NULL) AND (T_CAMPAIGN.ID = 15 AND T_CAMPAIGN.ID IS NOT NULL) AND (USER_CREATED_BY.TENANT_ID = 1 AND USER_CREATED_BY.TENANT_ID IS NOT NULL) AND (USER_MODIFIED_BY.TENANT_ID = 1 AND USER_MODIFIED_BY.TENANT_ID IS NOT NULL))
      === 2018-09-25 14:53:24,469 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] Setting DSRequest as being part of a transaction
      === 2018-09-25 14:53:24,470 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] Using paging strategy 'jdbcScroll' - scrolling to absolute position 1
      === 2018-09-25 14:53:24,470 [ec-3] DEBUG SQLDataSource - [builtinApplication.T_CAMPAIGN_update, builtinApplication.null] Scrolling / positioning took 0ms
      === 2018-09-25 14:53:24,470 [ec-3] INFO  DSResponse - [builtinApplication.T_CAMPAIGN_update] DSResponse: List with 1 items
      === 2018-09-25 14:53:24,470 [ec-3] INFO  DSResponse - DSResponse: List with 1 items
      === 2018-09-25 14:53:24,470 [ec-3] INFO  DSResponse - DSResponse: List with 1 items
      === 2018-09-25 14:53:24,470 [ec-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
      === 2018-09-25 14:53:24,471 [ec-3] DEBUG SQLTransaction - Rolling back Oracle transaction "1613788807"
      === 2018-09-25 14:53:24,471 [ec-3] DEBUG RPCManager - non-DMI response, dropExtraFields: false
      === 2018-09-25 14:53:24,471 [ec-3] DEBUG RPCManager - DMI response, dropExtraFields: true
      === 2018-09-25 14:53:24,471 [ec-3] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 2662
      Validator is applied in this way:
      Code:
      <field name="NAME" length="60" type="text" escapeHTML="true" required="true">
      <title><fmt:message key="name" /></title>
      <validators>
      <validator type="isUnique" serverOnly="true">
      <errorMessage><fmt:message key="validatorNameInUse" /></errorMessage>
      </validator>
      </validators>
      </field>
      That means, although I have a validator error, update is executed afterwards. Is that correct?

      Best regards
      Pavo
      Last edited by pavo123; 25 Sep 2018, 05:23.

      Comment


        #4
        Validation errors will cause no update to be executed, that's the default behavior, and you can quickly verify that in fact the system works that way.

        We can't tell what's going on here because we don't have your DataSource, any of the DMI logic, etc.

        Let us know if you find something that seems to suggest a framework bug.

        Comment

        Working...
        X