Announcement

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

  • Isomorphic
    replied
    You put together a huge but still incomplete test case purporting to reproduce a problem that doesn’t happen any more anyway?

    We don’t plan to try to piece this together to make it runnable. The result would almost certainly be to simply confirm that, no, we still can’t reproduce the problem, and you’re not having the problem anymore anyway.

    Leave a comment:


  • sidharth1917
    replied
    By the way the Spring issue also remains as it is and I am yet to check it with the latest nightly build.

    Leave a comment:


  • sidharth1917
    replied
    Hi,

    I tried this use case in a maven sample. Since the complete project was not allowd to be attached, I am only attaching major files from the sample. This sample is a MAVEN project and can be build using
    mvn clean install
    command.
    The AAListGrid have been trimmed down to be successfully sttached, but it has the code and properties I am using in the grid.

    The DB connection details needs to be provided in server.properties and in applicationContext.xml file. It expects a MYSQL database with schema name test and table name animals. Please create the table as per the animals.ds.xml.

    In this sample, please note that I am not using
    12.1-p20201118
    . Thus in this case, even when skipAudit is true, an audit entry is being created for the operation and audit_sequenceNumber is incremented accordingly. As soon as you update the version number to 12.1-p20201118, this starts working fine and as expected.

    Please have a look at it and let me know if you would need something else.
    Attached Files

    Leave a comment:


  • Isomorphic
    replied
    OK.....

    There was no change anywhere in the relevant code, so, the fact that updating to the latest version “fixed” the problem probably indicates that your environment has been getting corrupted in some way, and whatever process you used to update SmartGWT (perhaps restarting your IDE?) actually fixed that underlying corruption.

    This might also explain the mysterious Spring issue you are reporting. And it may explain why your team keeps reporting issues where we have a nearly 90% rate of never reproducing the problem (which is unique amongst all customers).

    So whatever you did.. please do it periodically, and make sure to do it before reporting any new bugs!

    Leave a comment:


  • sidharth1917
    replied
    Hi Team,

    I have updated my smartGWT version from
    12.1-p20200926
    to
    12.1-p20201118
    . This seems to have resolved the issue.

    Thanks for all the help and support.

    Leave a comment:


  • Isomorphic
    replied
    In your post #4 above, you state that with the builtin-DS sample project, you observed, as we do, that skipAudit works as expected for all operations, including UPDATE.

    So again, we have no valid bug report and no theory as to how you could have broken this simple mechanism in your project (that we don't have), so nothing can be done on our end.

    Leave a comment:


  • sidharth1917
    replied
    Hi,
    Though I have verified that skipAudit works fine in BuiltInDS sample and also a I have mentioned earlier as well, it works fine for ADD & REMOVE operations. It is only for UPDATE, that the skipAudit is ignored. Regarding the indication, I have verified that on the server we are always receiving the correct value of flag and then we simply do a dsRequest.execute() and hence I feel that this has something to do with the framework. Though I also agree that you would need a standalone example for the same and I am trying to provide you the same.

    Leave a comment:


  • Isomorphic
    replied
    As far as your attempt to modify the sample, see the docs for DataSource.audit - the default is to create a DataSource that is the same type as the DataSource being audited, but if you do that in this sample, you get a DataSource that is non-functional. The docs recommend setting auditDSConstructor to "sql" if you want a fully functional audit DataSource without coding anything.

    As far as how an audit record is still being created with skipAudit set, what you're reporting continues to seem completely impossible, and you've already demonstrated to yourself that the skipAudit feature works in general. We don't have your code and we have no way of reproducing the problem, so you need to isolate what the problem is. Let us know if you find any indication of a flaw in the framework.

    Leave a comment:


  • sidharth1917
    replied
    Hi,

    I even tried the server side code for the operation binding, where I logged the skipAudit value coming at the server side
    Code:
    @Override
        public DSResponse test(final DSRequest dsRequest) throws Exception {
            log.error("Audit is skipped: {}", dsRequest.isAuditSkipped());
            return dsRequest.execute();
        }
    This value is logged as TRUE. Still it is not skipping the audit entry and creating an AUDIT record for the operation. It is only happening for UPDATE operation and for ADD/REMOVE operation skipAudit works fine and as expected.
    Also, as I have mentioned earlier for the datasource fields I am using
    Code:
    audit="never"
    and still when the record is updated, the field shows up in audit_changedFields and the audit entry is created.

    As per your last comment, I was trying to implement my use case in the HibernateSpringDMI sample project (as my project is a Spring project ), but was not able to proceed as I am getting "Operation type 'fetch' not supported by this DataSource (audit_supplyItemSpringDMI)". Can you please let me know how can I make this work so that I will try my us case in this example as well and see if the same works here or not.

    I am also attaching the changed files from the sample.


    Please also help me in figuring out what area should I look into in my application to figure out the problem. SkipAudit workd for ADD/REMOVE operation but for UPDATE it is not working.
    Attached Files
    Last edited by sidharth1917; 23 Nov 2020, 01:24.

    Leave a comment:


  • Isomorphic
    replied
    The point was: the operationBinding does nothing except set skipAudit. So please try our suggestion, because the only other one we have is to try to isolate a test case that shows misbehavior.

    You’ve already proven to yourself that the feature works in general, so apparently, your code does something really strange that we can’t even guess.

    Leave a comment:


  • sidharth1917
    replied
    Hi,
    I dont think the operationBinding is completely non-functional because it is still updating the record in main DS. Also the ISC console shows operation as
    update<auditUpdate>
    .
    This DS does not have a transform request. I even tried inheriting the IDACALL servlet and in my CUSTOM IDACALL servlet doing a DSRequest.setskipAudit(true). Even with this there was a audit record being created for update.

    Please note that audit entry is only created for UPDATE operation. For ADD/REMOVE, it is working fine and no audit entry is created, as expected.

    Leave a comment:


  • Isomorphic
    replied
    Well, right now you have nothing on that operationBinding but the skipAudit flag. You could add a DMI (or Server Script) that calls setSkipAudit(true).

    That would also show you whether what's going on is that the operationBinding is completely non-functional vs it's just skipAudit. The operationBinding might be non-functional if you did something in DataSource.transformRequest, or in server side code customizing early processing like IDACall, which somehow dropped the operationId.

    Leave a comment:


  • sidharth1917
    replied
    Hi,

    For the first reason you have pointed out, I tried loading my Datasource. The loaded DS shows skipAudit as true.
    if (window.isc == undefined || window.isc.DataSource == undefined){ alert("Can't load DataSources - SmartClient runtime not loaded");}isc.DataSource.create({allowAdvancedCriteria:true,tableCode:"b482896b42b5c447755eef3abd79e115",audit:true,serverType:"sql",operationBindings:[{operationId:"auditUpdate",operationType:"update",skipAudit:true},{operationId:"auditAdd",operationType:"add",skipAudit:true},{operationId:"auditRemove",operationType:"remove",skipAudit:true}],isServerDS:true,ID:"ExternalCompanySQL",fields:[{name:"external_company_id",columnCode:"2de9bee7162adfa3f97a7ff99d78349b",hidden:true,type:"sequence",validators:[],primaryKey:true},{validators:[],joinType:"outer",name:"external_company_type_id",columnCode:"004fc495889a5405ada83480e69e601b",type:"integer",foreignKey:"CodeSQL.code_id",required:true},{validators:[],length:36,name:"company_id",columnCode:"447d30927af0c270a15f149d67f259a0",type:"text",foreignKey:"CompanySQL.company_id",required:true},{validators:[],length:100,name:"name",columnCode:"b068931cc450442b63f5b3d276ea4297",type:"text",title:"Name",required:true},{length:35,name:"address1",columnCode:"81e70cb16ec45f5ab19bb6638e8e6c2d",type:"text",title:"Address 1",validators:[]},{length:35,name:"address2",columnCode:"f669f8e9f6599d0dfcd613bc6e2f347e",type:"text",title:"Address 2",validators:[]},{length:35,name:"address3",columnCode:"87280cdb0f1e7ccb01e441b66999bd81",type:"text",title:"Address 3",validators:[]},{length:35,name:"city",columnCode:"4ed5d2eaed1a1fadcc41ad1d58ed603e",type:"text",title:"City",validators:[]},{length:2,name:"state",columnCode:"9ed39e2ea931586b6a985a6942ef573e",type:"text",title:"State",validators:[]},{length:10,name:"zip",columnCode:"adcdbd79a8d84175c229b192aadc02f2",type:"text",title:"Zip",validators:[]},{length:50,name:"country",columnCode:"e909c2d7067ea37437cf97fe11d91bd0",type:"text",title:"Country",validators:[]},{length:30,name:"phone",columnCode:"f7a42fe7211f98ac7a60a285ac3a9e87",type:"text",title:"Phone",validators:[]},{length:30,name:"fax",columnCode:"236c3b7f761221f195b428aca2f06c4b",type:"text",title:"Fax",validators:[]},{length:100,name:"email",columnCode:"0c83f57c786a0b4a39efab23731c7ebc",type:"text",title:"Email",validators:[]},{hidden:true,validators:[],joinType:"outer",name:"contact_id",columnCode:"6d82f13d88a5d6593ce9132a4fcdbf6d",type:"integer",foreignKey:"ContactSQL.contact_id"},{length:50,name:"account_number",columnCode:"e6ce04fec0627b47148e2bd197d2135c",type:"text",title:"Account Number",validators:[]},{name:"notes",columnCode:"4358b5009c67d0e31d7fbf1663fcd3bf",type:"text",title:"Notes",validators:[]},{hidden:true,validators:[],canEdit:false,name:"created_by",columnCode:"dad46b2058752ffde5eaf02f1eb6abd5",type:"creator",title:"Created By"},{hidden:true,audit:"never",validators:[],canEdit:false,name:"created_time",columnCode:"bb5855f0349346ae0b19eb381f00ab70",type:"creatorTimestamp",title:"Created Time"},{hidden:true,validators:[],canEdit:false,name:"modified_by",columnCode:"d6c05cd89c7b36759b8c0ee6c10204b8",type:"modifier",title:"Modified By"},{hidden:true,audit:"never",validators:[],canEdit:false,name:"modified_time",columnCode:"4f819a0bfbc6f5a469f90793d412b0dc",type:"modifierTimestamp",title:"Modified Time"}]})
    Also, in the posts above I have pasted the screenshot of my isc console which clearly shows the right operation ID being called.

    The second option of dsrequest.setSkipAudit(), I think this is for isomorphic DSRequest and not smartget.client DSRequest. I am making this call from client side code.

    Leave a comment:


  • Isomorphic
    replied
    The code that implements skipAudit is just a really straightforward call to DataSource.getOperationBinding().get("skipAudit").

    There's no obvious way to break it other than perhaps that your code is not actually using the DataSource you think it is (like you have two similarly-named ones around, or you added the skipAudit attribute in your IDE but never actually saved the file and restarted the server to see changes).

    Note there is also dsRequest.setSkipAudit() as a second means of skipping auditing.

    Leave a comment:


  • sidharth1917
    replied
    Just for your reference my DS.xml code is as follows:

    Code:
    <DataSource ID="ExternalCompanySQL"
                serverType="sql"
                tableName="external_company"
                audit="true"
                xmlns:fmt="WEB-INF/">
        <fmt:bundle basename="com.aaa.ppp.client.DSMessages"/>
        <fields>
            <field name="external_company_id" type="sequence" hidden="true" primaryKey="true"/>
            <field name="external_company_type_id" type="integer" foreignKey="CDSQL.code_id" joinType="outer" required="true"/>
            <field name="company_id" type="text" length="36" foreignKey="CMPSQL.company_id" required="true"/>
            <field name="name" type="text" length="100" required="true">
                <title>
                    <fmt:message key="name"/>
                </title>
            </field>
            <field name="address1" type="text" length="35">
                <title>
                    <fmt:message key="address1"/>
                </title>
            </field>
            <field name="address2" type="text" length="35">
                <title>
                    <fmt:message key="address2"/>
                </title>
            </field>
            <field name="address3" type="text" length="35">
                <title>
                    <fmt:message key="address3"/>
                </title>
            </field>
            <field name="city" type="text" length="35">
                <title>
                    <fmt:message key="city"/>
                </title>
            </field>
            <field name="state" type="text" length="2">
                <title>
                    <fmt:message key="state"/>
                </title>
            </field>
            <field name="zip" type="text" length="10">
                <title>
                    <fmt:message key="zip"/>
                </title>
            </field>
            <field name="country" type="text" length="50">
                <title>
                    <fmt:message key="country"/>
                </title>
            </field>
            <field name="phone" type="text" length="30">
                <title>
                    <fmt:message key="phone"/>
                </title>
            </field>
            <field name="fax" type="text" length="30">
                <title>
                    <fmt:message key="fax"/>
                </title>
            </field>
            <field name="email" type="text" length="100">
                <title>
                    <fmt:message key="email"/>
                </title>
            </field>
            <field name="contact_id" type="integer" foreignKey="CTSQL.contact_id" joinType="outer" hidden="true"/>
            <field name="account_number" type="text" length="50">
                <title>
                    <fmt:message key="accountNumber"/>
                </title>
            </field>
            <field name="notes" type="text">
                <title>
                    <fmt:message key="notes"/>
                </title>
            </field>
            <field name="created_by" type="creator" hidden="true" >
                <title>
                    <fmt:message key="createdBy"/>
                </title>
            </field>
            <field name="created_time" type="creatorTimestamp" hidden="true" audit="never">
                <title>
                    <fmt:message key="createdTime"/>
                </title>
            </field>
            <field name="modified_by" type="modifier" hidden="true">
                <title>
                    <fmt:message key="modifiedBy"/>
                </title>
            </field>
            <field name="modified_time" type="modifierTimestamp" hidden="true" audit="never">
                <title>
                    <fmt:message key="modifiedTime"/>
                </title>
            </field>
        </fields>
        <operationBindings>
            <operationBinding operationType="update" operationId="auditUpdate" skipAudit="true"/>
            <operationBinding operationType="add" operationId="auditAdd" skipAudit="true"/>
            <operationBinding operationType="remove" operationId="auditRemove" skipAudit="true"/>
        </operationBindings>
    </DataSource>

    Leave a comment:

Working...
X