Announcement

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

    Case sensitivity enhancement (or bug?) with ValidatorType.ISUNIQUE

    Hello Isomorphic,

    I'm using v10.0p_2015-03-25 and saw the following unexpected behavoir when changing just the case of a value in a field with following validator definition:

    Code:
    <field name="SHORTNAME" title="Kurzname" length="30" type="text" escapeHTML="true" required="true">
    	<validators>
    		<validator type="isUnique" errorMessage="Der Kurzname wird bereits verwendet!" />
    	</validators>
    </field>
    Request was to change the shortname from "Gold" to "GolD" (search for "gold" and "lower").

    Server Log:
    Code:
    === 2015-04-08 15:25:45,688 [c-28] INFO  RequestContext - URL: '/cust/lms/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0': Moz (Gecko) with Accept-Encoding header
    === 2015-04-08 15:25:45,690 [c-28] DEBUG RPCManager - Processing 1 requests.
    === 2015-04-08 15:25:45,690 [c-28] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            ID:59
        },
        values:{
            ID:59,
            SHORTNAME:"[B]GolD[/B]"
        },
        operationConfig:{
            dataSource:"T_CATEGORY1",
            repo:null,
            operationType:"update",
            textMatchStyle:"exact"
        },
        componentId:"isc_SettingVLayout_CategorySettings$4_0",
        appID:"builtinApplication",
        operation:"T_CATEGORY1_update",
        oldValues:{
            POSITION_DND:3,
            MODIFIED_AT:new Date(1428499517000),
            CREATED_BY:"12",
            NAME:"Gold",
            CREATED_AT:new Date(1427218930000),
            ID:59,
            SHORTNAME:"[B]Gold[/B]",
            MODIFIED_BY:"12",
            AVAILABLE:true,
            POSITION:3,
            TENANT_ID:12
        }
    }
    === 2015-04-08 15:25:45,690 [c-28] INFO  LMSIDACall - Performing 1 operation(s)
    === 2015-04-08 15:25:45,690 [c-28] DEBUG AppBase - [builtinApplication.T_CATEGORY1_update] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-04-08 15:25:45,690 [c-28] DEBUG AppBase - [builtinApplication.T_CATEGORY1_update] No public zero-argument method named '_T_CATEGORY1_update' found, performing generic datasource operation
    === 2015-04-08 15:25:45,691 [c-28] DEBUG AppBase - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-04-08 15:25:45,691 [c-28] DEBUG AppBase - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-04-08 15:25:45,691 [c-28] INFO  SQLDataSource - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Performing fetch operation with
    	criteria: {ID:59,TENANT_ID:12}	values: {ID:59,TENANT_ID:12}
    === 2015-04-08 15:25:45,691 [c-28] INFO  SQLDataSource - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
    === 2015-04-08 15:25:45,691 [c-28] INFO  SQLDataSource - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] 451: Executing SQL query on 'Oracle': SELECT T_CATEGORY1.ID, T_CATEGORY1.TENANT_ID, T_CATEGORY1.CREATED_BY, T_CATEGORY1.CREATED_AT, T_CATEGORY1.MODIFIED_BY, T_CATEGORY1.MODIFIED_AT, T_CATEGORY1.SHORTNAME, T_CATEGORY1.NAME, T_CATEGORY1.DESCRIPTION, T_CATEGORY1.POSITION, T_CATEGORY1.POSITION AS POSITION_DND, T_CATEGORY1.AVAILABLE FROM T_CATEGORY1 WHERE (T_CATEGORY1.ID=59 AND T_CATEGORY1.TENANT_ID=12)
    === 2015-04-08 15:25:45,691 [c-28] DEBUG SQLConnectionManager - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Borrowed connection '357604023'
    === 2015-04-08 15:25:45,691 [c-28] DEBUG SQLDriver - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] About to execute SQL query in 'Oracle' using connection '357604023'
    === 2015-04-08 15:25:45,691 [c-28] INFO  SQLDriver - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Executing SQL query on 'Oracle': SELECT T_CATEGORY1.ID, T_CATEGORY1.TENANT_ID, T_CATEGORY1.CREATED_BY, T_CATEGORY1.CREATED_AT, T_CATEGORY1.MODIFIED_BY, T_CATEGORY1.MODIFIED_AT, T_CATEGORY1.SHORTNAME, T_CATEGORY1.NAME, T_CATEGORY1.DESCRIPTION, T_CATEGORY1.POSITION, T_CATEGORY1.POSITION AS POSITION_DND, T_CATEGORY1.AVAILABLE FROM T_CATEGORY1 WHERE (T_CATEGORY1.ID=59 AND T_CATEGORY1.TENANT_ID=12)
    === 2015-04-08 15:25:45,692 [c-28] INFO  DSResponse - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] DSResponse: List with 1 items
    === 2015-04-08 15:25:45,692 [c-28] DEBUG SQLDriver - [builtinApplication.T_CATEGORY1_update] Freeing SQLDriver dbConnection 357604023
    === 2015-04-08 15:25:45,692 [c-28] DEBUG SQLConnectionManager - [builtinApplication.T_CATEGORY1_update] About to close  with hashcode "357604023"
    === 2015-04-08 15:25:45,692 [c-28] DEBUG AppBase - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-04-08 15:25:45,692 [c-28] DEBUG AppBase - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-04-08 15:25:45,693 [c-28] INFO  SQLDataSource - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Performing fetch operation with
    	outputs: [ID, SHORTNAME]	criteria: {SHORTNAME:"GolD",TENANT_ID:12}	values: {SHORTNAME:"GolD",TENANT_ID:12}
    === 2015-04-08 15:25:45,693 [c-28] INFO  SQLDataSource - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
    === 2015-04-08 15:25:45,693 [c-28] INFO  SQLDataSource - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] 59: Executing SQL query on 'Oracle': SELECT T_CATEGORY1.ID, T_CATEGORY1.SHORTNAME FROM T_CATEGORY1 WHERE ([B]LOWER(T_CATEGORY1.SHORTNAME)='gold'[/B] AND T_CATEGORY1.TENANT_ID=12)
    === 2015-04-08 15:25:45,693 [c-28] DEBUG SQLConnectionManager - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Borrowed connection '357604023'
    === 2015-04-08 15:25:45,693 [c-28] DEBUG SQLTransaction - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Started new Oracle transaction "357604023"
    === 2015-04-08 15:25:45,693 [c-28] DEBUG SQLDriver - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] About to execute SQL query in 'Oracle' using connection '357604023'
    === 2015-04-08 15:25:45,693 [c-28] INFO  SQLDriver - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] Executing SQL query on 'Oracle': SELECT T_CATEGORY1.ID, T_CATEGORY1.SHORTNAME FROM T_CATEGORY1 WHERE ([B]LOWER(T_CATEGORY1.SHORTNAME)='gold'[/B] AND T_CATEGORY1.TENANT_ID=12)
    === 2015-04-08 15:25:45,693 [c-28] INFO  DSResponse - [builtinApplication.T_CATEGORY1_update, builtinApplication.null] DSResponse: List with 1 items
    === 2015-04-08 15:25:45,694 [c-28] DEBUG DefaultValidators - [builtinApplication.T_CATEGORY1_update] unique check: pkField: ID, old PK: 59, new PK: 59
    === 2015-04-08 15:25:45,694 [c-28] DEBUG DefaultValidators - [builtinApplication.T_CATEGORY1_update] unique check: unique field: SHORTNAME, old unique value: Gold, new unique value: GolD
    === 2015-04-08 15:25:45,694 [c-28] DEBUG ValidationContext - [builtinApplication.T_CATEGORY1_update] Adding validation errors at path '/T_CATEGORY1/SHORTNAME/SHORTNAME': {errorMessage=Der Kurzname wird bereits verwendet!}
    === 2015-04-08 15:25:45,694 [c-28] INFO  Validation - [builtinApplication.T_CATEGORY1_update] Validation error: [
        {
            SHORTNAME:{
                errorMessage:"Der Kurzname wird bereits verwendet!"
            }
        }
    ]
    === 2015-04-08 15:25:45,694 [c-28] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2015-04-08 15:25:45,694 [c-28] DEBUG SQLTransaction - Rolling back Oracle transaction "357604023"
    === 2015-04-08 15:25:45,694 [c-28] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2015-04-08 15:25:45,694 [c-28] DEBUG SQLTransaction - getConnection() found transactional connection for Oracle with hashcode "357604023"
    === 2015-04-08 15:25:45,694 [c-28] DEBUG SQLTransaction - Ending Oracle transaction "357604023"
    === 2015-04-08 15:25:45,694 [c-28] DEBUG SQLConnectionManager - About to close  with hashcode "357604023"
    === 2015-04-08 15:25:45,694 [c-28] INFO  Compression - /cust/lms/sc/IDACall: 236 -> 204 bytes
    I'd suggest that the case sensitivity here is up to the user (with an attribute in the validator definition). From my feeling the current behaviour is wrong, but that might be because my database unique constraint is also case sensitive.

    Best regards,
    Blama

    #2
    We think the current case insensitive search is the desirable default behavior, but we will most likely add a boolean property to control this for a future version.

    Comment


      #3
      The "caseSensitive" boolean property has been implemented for the 10.1 branch, which applies only to the "isUnique" validator, and will be available in nightly builds as of tomorrow, 04/11

      Regards,
      Isomorphic Software

      Comment


        #4
        Hi Isomorphic,

        I did not test it so far, but FYI, the 5.1d docs do not mention the attribute, yet.

        Best regards
        Blama

        Comment


          #5
          A description of the caseSenstive attribute default state and a link to it has now been added to the 10.1 documentation for the isUnique validator. New docs will be available online once the nightly builds have been triggered and built.

          Regards,
          Isomorphic Software

          Comment


            #6
            Hi Isomorphic,

            this is working for me, thank you!

            Best regards
            Blama

            Comment

            Working...
            X