Announcement

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

    SQLExpressions warnings in 13.1

    Hello, In the more recent 13.1 builds, I’ve noticed WARN messages like the following:

    Code:
    WARN  SQLExpressions SQLExpression for field 'EMAIL' already exists, skip.
    These seem harmless, but I’d like to understand more about their meaning.

    Then, there are others like:

    Code:
    WARN SQLExpressions Missing expression for the 'ID_ROLE_FK' field of the 'AUTH_MENU_ROLES_PERMISSIONS' DataSource.
    In some cases, these seem related to a regression in at least one specific operationBinding. After this warning, the criteria for that field doesn’t appear in the WHERE clause, whereas previously it did.

    The field is defined as:

    Code:
     <field name="ID_ROLE_FK" type="integer" customSelectExpression="MENU_ROLES.ID_ROLE_FK" customSQL="true"/>
    And the operationBinding includes it in the customCriteriaFields:

    Code:
           <operationBinding operationType="fetch" operationId="fetchMenuPerGestioneUtenti"
                              serverMethod="fetchMenuPerGestioneUtenti"
                              requiresRole="ROLE_ADMIN, ROLE_USERADMIN, ROLE_ADMIN_SCOUT, ADMIN"
                              customFields="IS_MENU_FROM_ROLE,IS_MENU_FROM_PERMISSION,ID_ROLES,ROLE_NAMES,ID_PERMISSIONS,PERMISSION_NAMES"
                              customCriteriaFields="ID_PERMISSION_FK,ID_ROLE_FK">
                <serverObject lookupStyle="new" className="com.juve.auth.menu.FetchMenuPerGestioneUtenti"/>
                <tableClause>
                    $defaultTableClause
                    LEFT JOIN DBJFRAME.AUTH_MENU_ROLES MENU_ROLES ON TREE_MENU.ID_REC = MENU_ROLES.ID_MENU_FK
                    LEFT JOIN DBJFRAME.AUTH_ROLES ROLES ON MENU_ROLES.ID_ROLE_FK = ROLES.ID_REC
                    LEFT JOIN DBJFRAME.AUTH_MENU_PERMISSIONS MENU_PERMISSIONS ON TREE_MENU.ID_REC = MENU_PERMISSIONS.ID_MENU_FK
                    LEFT JOIN DBJFRAME.AUTH_PERMISSIONS PERMISSIONS ON MENU_PERMISSIONS.ID_PERMISSION_FK = PERMISSIONS.ID_REC
                </tableClause>
                <whereClause>
                    $defaultWhereClause
                    #if ($sessionAttributes.appID != 'JcaAuth')
                        and TREE_MENU.ID_APP = $sessionAttributes.appID
                    #end
                </whereClause>
                <groupBy>ID_REC</groupBy>
                <groupBy>ID_APP</groupBy>
                <groupBy>VOCE_MENU</groupBy>
                <groupBy>VOCE_MENU_EN</groupBy>
                <groupBy>ID_FUNZIONE</groupBy>
                <groupBy>ORDINAMENTO_PER_LIVELLO</groupBy>
                <groupBy>ID_VOCE_PADRE</groupBy>
                <groupBy>ICONA</groupBy>
                <groupBy>ICONA_SVG</groupBy>
                <groupBy>IS_MENU_FROM_ROLE</groupBy>
                <groupBy>IS_MENU_FROM_PERMISSION</groupBy>
                <groupBy>ID_MENU_FK</groupBy>
                <summaryFunctions>
                    <ID_ROLES>concat</ID_ROLES>
                    <ROLE_NAMES>concat</ROLE_NAMES>
                    <ID_PERMISSIONS>concat</ID_PERMISSIONS>
                    <PERMISSION_NAMES>concat</PERMISSION_NAMES>
                    <IS_DASHBOARD_VISIBLE>max</IS_DASHBOARD_VISIBLE>
                    <MOBILE_PHONE_VISIBLE>max</MOBILE_PHONE_VISIBLE>
                    <TABLET_VISIBLE>max</TABLET_VISIBLE>
                    <MOBILE_PHONE_DEFAULT>max</MOBILE_PHONE_DEFAULT>
                    <MOBILE_PHONE_ONLY>max</MOBILE_PHONE_ONLY>
                </summaryFunctions>
                <orderClause>ORDINAMENTO_PER_LIVELLO</orderClause>
            </operationBinding>
    There’s one caveat: the DMI is actually calling dsRequest.addToCriteria() to add the criteria for the ID_ROLE_FK field.

    Please let me know if this sheds some light, or if I should try to create a test case (though that might be difficult).

    #2
    Hello, please let me know if you may know where it's the problem, or if you need a real test case

    Comment


      #3
      We have identified the issue with the ID_ROLE_FK field, and a fix will be provided shortly.

      Regarding the warning about the missing EMAIL field, could you please provide steps to reproduce it? We've made some changes to the SQL engine in version 13.1, and this warning should only be logged when the system expects an expression for the field to inject into the SQL query but finds it missing. This could either be an unnecessary warning or an indication that the issue is not as harmless as it seems.

      Comment


        #4
        The issue with the missing ID_ROLE_FK field has been resolved and will be available for download in the nightly builds starting today (Sep 25).

        Comment


          #5
          Hello, thanks, now I don't see the WARN about ID_ROLE_FK, but I've got a NullPointerException:

          Code:
          2024-09-25T12:49:54,139 WARN RequestContext dsRequest.execute() failed:
          java.lang.NullPointerException: null
              at com.isomorphic.datasource.IncludeFromDefinition.isDynamicInclusion(IncludeFromDefinition.java:132) ~[isomorphic-core-rpc-13.1-d20240925.jar:?]
              at com.isomorphic.datasource.DSRequest.createIncludeFromDefinitionFromCriteria(DSRequest.java:8193) ~[isomorphic-core-rpc-13.1-d20240925.jar:?]
              at com.isomorphic.datasource.DSRequest.addToCriteria(DSRequest.java:9499) ~[isomorphic-core-rpc-13.1-d20240925.jar:?]
              at com.isomorphic.datasource.DSRequest.addToCriteria(DSRequest.java:9552) ~[isomorphic-core-rpc-13.1-d20240925.jar:?]
              at com.isomorphic.datasource.DSRequest.addToCriteria(DSRequest.java:9577) ~[isomorphic-core-rpc-13.1-d20240925.jar:?]

          Comment


            #6
            Originally posted by Isomorphic View Post
            Regarding the warning about the missing EMAIL field, could you please provide steps to reproduce it? We've made some changes to the SQL engine in version 13.1, and this warning should only be logged when the system expects an expression for the field to inject into the SQL query but finds it missing. This could either be an unnecessary warning or an indication that the issue is not as harmless as it seems.
            Hello, while I can confirm that this warning doesn't seem to be linked to an actual problem (I've got many of them), I haven't been able to identify a certain single cause for it. It appears that the warnings are always related to "includeFrom" fields, but they don't occur for every includeFrom field.

            Comment

            Working...
            X