Announcement

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

    Field type="modifier" does not get set with current user

    I have verified in debug that req.getHttpServletRequest().getRemoteUser() does in fact have the correct value for the logged in user just prior to the request being processed by the framework. But the SQL INSERT that gets generated has modifiedBy=''. Here is the server log showing the update request.
    Code:
    === 2012-02-28 08:30:06,349 [l0-0] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            id:2
        },
        values:{
            id:2,
            address1:"123 main street"
        },
        operationConfig:{
            dataSource:"BuyingAgent",
            operationType:"update"
        },
        componentId:"isc_ValuesManager_2",
        appID:"builtinApplication",
        operation:"BuyingAgent_update",
        oldValues:{
            id:2,
            modifiedOn:new Date(1330439324000),
            modifiedBy:"",
            name:"Secret Agent",
            state:"",
            postCode:"abc 123",
            address1:"123 main",
            address2:"",
            externalId:"ABC123",
            agentFee:9.11111,
            country:"US",
            city:"somewhere",
            _selection_12:true
        }
    }
     --- RPC Operations 1=== 2012-02-28 08:30:06,349 [l0-0] INFO  IpIDACall - Performing 1 operation(s)
    === 2012-02-28 08:30:06,349 [l0-0] DEBUG AppBase - [builtinApplication.BuyingAgent_update] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-02-28 08:30:06,349 [l0-0] DEBUG AppBase - [builtinApplication.BuyingAgent_update] No public zero-argument method named '_BuyingAgent_update' found, performing generic datasource operation
    === 2012-02-28 08:31:31,924 [l0-0] INFO  SQLDataSource - [builtinApplication.BuyingAgent_update] Performing update operation with
    	criteria: {id:2}	values: {id:2,address1:"123 main street",modifiedOn:new Date(1330439406349),modifiedBy:""}
    === 2012-02-28 08:31:31,925 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.BuyingAgent_update] DriverManager fetching connection for iptsfil4 via jdbc url jdbc:as400://ilava;naming=system;prompt=false;user=IPGUI;password=IPGUI;libraries=IPTSFIL4,IPWMFIL4,IPPAFIL4,IPASFIL4,IPTSUTL,PRIMARK
    === 2012-02-28 08:31:31,925 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.BuyingAgent_update] Passing JDBC URL only to getConnection
    === 2012-02-28 08:31:32,474 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.BuyingAgent_update] Returning pooled Connection
    === 2012-02-28 08:31:32,474 [l0-0] INFO  SQLDriver - [builtinApplication.BuyingAgent_update] Executing SQL update on 'iptsfil4': UPDATE BuyingAgent SET address1='123 main street', modifiedBy='', modifiedOn='2012-02-28 08:30:06' WHERE (BuyingAgent.id='2')
    === 2012-02-28 08:31:33,175 [l0-0] DEBUG SQLDataSource - [builtinApplication.BuyingAgent_update] update operation affected 1 rows
    === 2012-02-28 08:31:33,175 [l0-0] INFO  SQLDataSource - [builtinApplication.BuyingAgent_update] primaryKeys: {id=2}

    #2
    The value comes from RPCManager.getUserId(), which uses servletRequest.getRemoteUser() *if* you have not called RPCManager.setUserId(). These logs suggest a call to setUserId("") in your code?

    Another possibility would be some kind of redirect or filter that introduces a facade servletRequest object where getRemoteUser() is broken. Try creating a DMI with servletRequest as a parameter - the object you receive is the same one we call getRemoteUser() on.

    Comment

    Working...
    X