Announcement

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

    operationBinding.skipAudit not working

    SmartClient Version: SNAPSHOT_v11.1d_2017-03-23/Enterprise Deployment (built 2017-03-23)

    Chrome on OSX

    Hello, it seems that skipAudit is not working. These are my dataSources:

    PREFERENZE_UTENTI.ds.xml:

    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                dbName="dbJFrame" schema="DBJFRAME"
                tableName="PREFERENZE_UTENTI"
                ID="PREFERENZE_UTENTI"
                serverType="sql"
                dataFormat="iscServer"
                requiresAuthentication="true"
                audit="true"
                auditDataSourceID="AUDIT_PREFERENZE_UTENTI"
                auditRevisionFieldName="AUDIT_REVISION"
                auditTimeStampFieldName="AUDIT_CHANGETIME"
                auditTypeFieldName="AUDIT_OPERATIONTYPE"
                auditUserFieldName="AUDIT_MODIFIER"
    >
        <fmt:bundle basename="i18nMessages" encoding="utf-8"/>
        <fields>
            <field sqlType="decimal" primaryKey="true" name="ID_REC" type="sequence" hidden="true">
                <sequenceName>SEQUENCE_REC</sequenceName>
            </field>
            <field sqlType="varchar" sqlLength="100" name="ID_USER" length="100" type="text">
                    <!--customUpdateExpression="$sessionAttributes.userDetails.username"
    
                    <customSelectExpression>
                    $sessionAttributes.userDetails.username
                    </customSelectExpression>-->
                    </field>
            <field sqlType="varchar" sqlLength="256" name="ID_WIDGET" length="256" type="text"></field>
            <field sqlType="varchar" sqlLength="255" name="NAME" length="255" type="text"></field>
            <field sqlType="clob" name="VALUE" type="text"></field>
            <field sqlType="varchar" sqlLength="1" name="DEFAULT_PREF" type="boolean" sqlStorageStrategy="singleCharTF"></field>
            <field name="ID_APP" type="text" required="true" length="20" hidden="true"/>
    
        </fields>
          <operationBindings>
            <operationBinding operationType="remove" skipAudit="true">
                <whereClause>$defaultWhereClause</whereClause>
            </operationBinding>
          </operationBindings>
    </DataSource>
    and AUDIT_PREFERENZE_UTENTI.ds.xml:

    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                dbName="dbJFrame" schema="DBJFRAME"
                tableName="AUDIT_PREFERENZE_UTENTI"
                ID="AUDIT_PREFERENZE_UTENTI"
                serverType="sql"
                dataFormat="iscServer"
                requiresAuthentication="true"
    >
        <fmt:bundle basename="i18nMessages" encoding="utf-8"/>
        <fields>
            <field sqlType="decimal" name="ID_REC" type="integer" hidden="true">
            </field>
            <field sqlType="varchar" sqlLength="100" name="ID_USER" length="100" type="text"></field>
            <field sqlType="varchar" sqlLength="256" name="ID_WIDGET" length="256" type="text"></field>
            <field sqlType="varchar" sqlLength="255" name="NAME" length="255" type="text"></field>
            <field sqlType="clob" name="VALUE" type="text"></field>
            <field sqlType="varchar" sqlLength="1" name="DEFAULT_PREF" type="boolean" sqlStorageStrategy="singleCharTF"></field>
            <field name="ID_APP" type="text" length="20" hidden="true"/>
            <field sqlType="decimal" primaryKey="true" sqlLength="38" name="AUDIT_REVISION" type="sequence" sequenceName="SEQUENCE_REC"></field>
            <field sqlType="varchar" sqlLength="255" name="AUDIT_OPERATIONTYPE" length="255" type="text"></field>
            <field sqlType="timestamp" sqlLength="7" name="AUDIT_CHANGETIME" type="datetime"></field>
            <field sqlType="varchar" sqlLength="255" name="AUDIT_MODIFIER" length="255" type="text"></field>
        </fields>
    </DataSource>
    I've noticed the behavior while doing a remove (but it is ignored for an update also), this is the tomcat log:
    Code:
    2017-03-23 14:59:29,937 DEBUG RPCManager Request #1 (DSRequest) payload: {
        criteria:{
            ID_REC:525368
        },
        operationConfig:{
            dataSource:"PREFERENZE_UTENTI",
            repo:null,
            operationType:"remove",
            textMatchStyle:"exact"
        },
        appID:"builtinApplication",
        operation:"PREFERENZE_UTENTI_remove",
        oldValues:{
            ID_REC:525368
        }
    } 
    2017-03-23 14:59:29,937 INFO  IDACall Performing 1 operation(s) 
    2017-03-23 14:59:29,937 DEBUG DeclarativeSecurity Processing security checks for DataSource null, field null 
    2017-03-23 14:59:29,937 DEBUG DeclarativeSecurity DataSource PREFERENZE_UTENTI is not in the pre-checked list, processing... 
    2017-03-23 14:59:29,937 DEBUG AppBase [builtinApplication.PREFERENZE_UTENTI_remove] No userTypes defined, allowing anyone access to all operations for this application 
    2017-03-23 14:59:29,937 DEBUG AppBase [builtinApplication.PREFERENZE_UTENTI_remove] No public zero-argument method named '_PREFERENZE_UTENTI_remove' found, performing generic datasource operation 
    2017-03-23 14:59:29,937 INFO  SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove] Performing remove operation with
        criteria: {ID_REC:525368}    values: {ID_REC:525368} 
    2017-03-23 14:59:29,939 DEBUG PoolableSQLConnectionFactory [builtinApplication.PREFERENZE_UTENTI_remove] makeObject() created an unpooled Connection '977222485' 
    2017-03-23 14:59:29,939 DEBUG SQLConnectionManager [builtinApplication.PREFERENZE_UTENTI_remove] Borrowed connection '977222485' 
    2017-03-23 14:59:29,939 DEBUG SQLTransaction [builtinApplication.PREFERENZE_UTENTI_remove] Started new dbJFrame transaction "977222485" 
    2017-03-23 14:59:29,939 DEBUG SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove] Setting DSRequest as being part of a transaction 
    2017-03-23 14:59:29,939 INFO  SQLDriver [builtinApplication.PREFERENZE_UTENTI_remove] Executing SQL query on 'dbJFrame' using connection '977222485': DELETE FROM DBJFRAME.PREFERENZE_UTENTI WHERE (PREFERENZE_UTENTI.ID_REC=525368) 
    2017-03-23 14:59:29,941 DEBUG SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove] remove operation affected 1 rows 
    2017-03-23 14:59:29,941 DEBUG AuditDSGenerator [builtinApplication.PREFERENZE_UTENTI_remove] AUDIT_PREFERENZE_UTENTI is an audit DataSource, processing 
    2017-03-23 14:59:29,942 DEBUG SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove] DataSource 18378 acquired SQLDriver instance 223373139 during initialization 
    2017-03-23 14:59:29,942 DEBUG SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove] DataSource 18379 acquired SQLDriver instance 430932217 during initialization 
    2017-03-23 14:59:29,942 DEBUG SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove] About to clear SQLDriver state for DS instance 18378 
    2017-03-23 14:59:29,942 DEBUG AuditDSGenerator [builtinApplication.PREFERENZE_UTENTI_remove] getAuditUserFieldName returns AUDIT_MODIFIER 
    2017-03-23 14:59:29,942 DEBUG AuditDSGenerator [builtinApplication.PREFERENZE_UTENTI_remove] getAuditTypeFieldName returns AUDIT_OPERATIONTYPE 
    2017-03-23 14:59:29,942 DEBUG AuditDSGenerator [builtinApplication.PREFERENZE_UTENTI_remove] getAuditTimestampFieldName returns AUDIT_CHANGETIME 
    2017-03-23 14:59:29,942 DEBUG DeclarativeSecurity [builtinApplication.PREFERENZE_UTENTI_remove] Processing security checks for DataSource null, field null 
    2017-03-23 14:59:29,942 DEBUG DeclarativeSecurity [builtinApplication.PREFERENZE_UTENTI_remove] Request is not a client request, ignoring security checks. 
    2017-03-23 14:59:29,942 DEBUG AppBase [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application 
    2017-03-23 14:59:29,942 DEBUG AppBase [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation 
    2017-03-23 14:59:29,943 DEBUG DataSource [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] post-validation valueSet: [
        {
            AUDIT_MODIFIER:"claudio.bosticco@juventus.com",
            ID_REC:525368,
            AUDIT_OPERATIONTYPE:"remove",
            AUDIT_CHANGETIME:new Date(1490277569942)
        }
    ] 
    2017-03-23 14:59:29,943 INFO  SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] Performing add operation with
        criteria: {AUDIT_MODIFIER:"claudio.bosticco@juventus.com",ID_REC:525368,AUDIT_OPERATIONTYPE:"remove",AUDIT_CHANGETIME:new Date(1490277569942)}    values: {AUDIT_MODIFIER:"claudio.bosticco@juventus.com",ID_REC:525368,AUDIT_OPERATIONTYPE:"remove",AUDIT_CHANGETIME:new Date(1490277569942)} 
    2017-03-23 14:59:29,943 DEBUG SQLValuesClause [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] Sequences: {AUDIT_REVISION=SEQUENCE_REC} 
    2017-03-23 14:59:29,944 DEBUG SQLDataSource [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] Setting DSRequest as being part of a transaction 
    2017-03-23 14:59:29,944 INFO  SQLDriver [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] Executing SQL query on 'dbJFrame' using connection '977222485': INSERT INTO DBJFRAME.AUDIT_PREFERENZE_UTENTI (AUDIT_CHANGETIME, AUDIT_MODIFIER, AUDIT_OPERATIONTYPE, ID_REC, AUDIT_REVISION) VALUES (TO_DATE('2017-03-23 14:59:29','YYYY-MM-DD HH24:MI:SS'), 'claudio.bosticco@juventus.com', 'remove', 525368, DBJFRAME.SEQUENCE_REC.NextVal) 
    2017-03-23 14:59:29,949 DEBUG SQLDriver [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] SequenceMode is not JDBC_DRIVER, skipping search for generated values 
    2017-03-23 14:59:29,949 DEBUG SQLDriver [builtinApplication.PREFERENZE_UTENTI_remove, builtinApplication.null] FAILED to execute SQL update in 'dbJFrame' using connection'977222485' 
    2017-03-23 14:59:29,950 DEBUG DSRequest [builtinApplication.PREFERENZE_UTENTI_remove] freeOnExecute is false for request of type add on DataSource AUDIT_PREFERENZE_UTENTI - not freeing resources! 
    2017-03-23 14:59:29,951 DEBUG PoolableSQLConnectionFactory [builtinApplication.PREFERENZE_UTENTI_remove] makeObject() created an unpooled Connection '1439898469' 
    2017-03-23 14:59:29,951 DEBUG SQLConnectionManager [builtinApplication.PREFERENZE_UTENTI_remove] Borrowed connection '1439898469' 
    2017-03-23 14:59:29,951 DEBUG SQLDriver [builtinApplication.PREFERENZE_UTENTI_remove] Checking for table existence with query: SELECT * FROM DBJFRAME.AUDIT_PREFERENZE_UTENTI WHERE '0'='1' 
    2017-03-23 14:59:29,956 DEBUG SQLDriver [builtinApplication.PREFERENZE_UTENTI_remove] Test query succeeded 
    2017-03-23 14:59:29,956 ERROR DataSource [builtinApplication.PREFERENZE_UTENTI_remove] Unable to write to audiDS: AUDIT_PREFERENZE_UTENTI 
    java.sql.SQLIntegrityConstraintViolationException: ORA-01400: impossibile inserire NULL in ("DBJFRAME"."AUDIT_PREFERENZE_UTENTI"."ID_APP")
    is it a bug or am I missing something?

    #2
    Note: I've just tried dsRequest.setSkipAudit(true); and it works.

    Comment


      #3
      This is fixed and will be available in nightly builds since Mar 25 (tomorrow).

      Comment

      Working...
      X