Announcement

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

    JPA2DataSource app freezes

    Hi,

    I'm truing to create my first JPA2DataSource.
    I created a .ds.xml file and overrided fields in order to put there validators.

    Fetch operation works fine.
    add and update operation freezes application. I receive "Operation time out" after a while and the lisdGrid will not load up data again, even after closing and opening a browser. (I have connection pool set to 1).

    when I try to update record as follows then it work and data get saved.
    Code:
    record=userGrid.getSelectedRecord();
    record.setAttribute("active", false);
    userGrid.updateData(record);
    when I use value manager data are loaded into a dynamic form.
    Code:
    ListGridRecord record = userGrid.getSelectedRecord();
    valuesManager.editRecord(record);
    when try to save the call will never make it into the execute method
    Code:
    valuesManager.saveData(new DSCallback() {
    	@Override
    	public void execute(DSResponse response, Object rawData, DSRequest request) {
    		destroy();//window
    	}
    });
    I had to copy groovy-1.8.2.jar into a classpath because of class not found exception.

    I don't know how to prepare a test csae for you since I would have to copy all my JPA entities and without a database it's pointless anyway.
    At least, please find attached a relevant files.

    tested on smartGWT 3.0 20-09-2011

    RPC request
    Code:
    {
        "actionURL":"http://127.0.0.1:8888/smartrise/sc/IDACall", 
        "showPrompt":true, 
        "prompt":"Saving form...", 
        "transport":"xmlHttpRequest", 
        "promptStyle":"cursor", 
        "bypassCache":true, 
        "data":{
            "criteria":{
                "id":1
            }, 
            "values":{
                "userByCreatedByFirstName":"System", 
                "regionDisplayText":"92 - Bratislava Východ", 
                "regionId":1, 
                "icon":"ROLE_VIEWER", 
                "userGroupName":"ROLE_VIEWER", 
                "userGroupId":2, 
                "userByCreatedBySurname":"Admin", 
                "accountLocked":false, 
                "active":true, 
                "changePassword":false, 
                "checkUserIp":false, 
                "dateOfChange":null, 
                "dateOfCreation":"2011-09-19T13:58:00", 
                "defaultLanguage":null, 
                "email":"daniel.sterba@capacitypro.eu", 
                "failedLoginAttempts":0, 
                "id":1, 
                "lastFailedLogin":null, 
                "lastLoginErrorCode":null, 
                "lastSuccessfulLogin":"2011-09-21T14:00:46", 
                "login":"tester2", 
                "loginCount":16, 
                "loginDelay":0, 
                "middleName":"", 
                "name":"System", 
                "pwd":"763bbf73f4bcfd59131f5008601149c0", 
                "surname":"Admin", 
                "_selection_9":true
            }, 
            "operationConfig":{
                "dataSource":"usersDS", 
                "repo":null, 
                "operationType":"update"
            }, 
            "componentId":"isc_ValuesManager_0", 
            "appID":"builtinApplication", 
            "operation":"usersDS_update", 
            "oldValues":{
                "userByCreatedByFirstName":"System", 
                "regionDisplayText":"92 - Bratislava Východ", 
                "regionId":1, 
                "icon":"ROLE_VIEWER", 
                "userGroupName":"ROLE_VIEWER", 
                "userGroupId":2, 
                "userByCreatedBySurname":"Admin", 
                "accountLocked":false, 
                "active":false, 
                "changePassword":false, 
                "checkUserIp":false, 
                "dateOfChange":null, 
                "dateOfCreation":"2011-09-19T13:58:00", 
                "defaultLanguage":null, 
                "email":"daniel.sterba@capacitypro.eu", 
                "failedLoginAttempts":0, 
                "id":1, 
                "lastFailedLogin":null, 
                "lastLoginErrorCode":null, 
                "lastSuccessfulLogin":"2011-09-21T14:00:46", 
                "login":"tester2", 
                "loginCount":16, 
                "loginDelay":0, 
                "middleName":"", 
                "name":"System", 
                "pwd":"763bbf73f4bcfd59131f5008601149c0", 
                "surname":"Admin", 
                "_selection_9":true
            }, 
            "streamResults":null, 
            "exportToFilesystem":null, 
            "exportToClient":null
        }
    }
    server log:
    Code:
    === 2011-09-21 16:01:00,628 [l0-2] DEBUG XML - Parsed XML from (in memory stream): 2ms
    === 2011-09-21 16:01:00,631 [l0-2] DEBUG RPCManager - Processing 2 requests.
    === 2011-09-21 16:01:00,631 [l0-2] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'regionsDS/id' for field 'regionId'. Treating as simple field.
    === 2011-09-21 16:01:00,631 [l0-2] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'userGroupsDS/id' for field 'userGroupId'. Treating as simple field.
    === 2011-09-21 16:01:00,632 [l0-2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        values:{
            changePassword:false,
            id:1,
            login:"tester2",
            userGroupId:2,
            active:true
        },
        operationConfig:{
            dataSource:"usersDS",
            operationType:"validate"
        },
        validationMode:"full",
        appID:"builtinApplication",
        operation:"usersDS_validate",
        oldValues:{
            changePassword:false,
            id:1,
            login:"tester2",
            userGroupId:2,
            active:true
        },
        criteria:{
        }
    }
    === 2011-09-21 16:01:00,632 [l0-2] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'regionsDS/id' for field 'regionId'. Treating as simple field.
    === 2011-09-21 16:01:00,632 [l0-2] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'userGroupsDS/id' for field 'userGroupId'. Treating as simple field.
    === 2011-09-21 16:01:00,633 [l0-2] DEBUG RPCManager - Request #2 (DSRequest) payload: {
        values:{
            changePassword:false,
            id:1,
            login:"tester2",
            userGroupId:2,
            active:true
        },
        operationConfig:{
            dataSource:"usersDS",
            operationType:"validate"
        },
        validationMode:"full",
        appID:"builtinApplication",
        operation:"usersDS_validate",
        oldValues:{
            changePassword:false,
            id:1,
            login:"tester2",
            userGroupId:2,
            active:true
        },
        criteria:{
        }
    }
    === 2011-09-21 16:01:00,633 [l0-2] INFO  IDACall4Spring - IDACall - Performing 2 operation(s)
    === 2011-09-21 16:01:00,633 [l0-2] DEBUG AppBase - [builtinApplication.usersDS_validate] No userTypes defined, allowing anyone access to all operations for this application
    === 2011-09-21 16:01:00,633 [l0-2] DEBUG AppBase - [builtinApplication.usersDS_validate] No public zero-argument method named '_usersDS_validate' found, performing generic datasource operation
    === 2011-09-21 16:01:00,633 [l0-2] DEBUG JPADataSource - [builtinApplication.usersDS_validate] Creating EntityManager and starting transaction.
    === 2011-09-21 16:01:00,633 [l0-2] DEBUG DSRequest - [builtinApplication.usersDS_validate] Clobbering existing FreeResourcesHandler of type 'com.isomorphic.jpa.JPA2DataSource' with a 'com.isomorphic.jpa.JPA2DataSource'
    === 2011-09-21 16:01:00,634 [l0-2] WARN  BasicDataSource - [builtinApplication.usersDS_validate] Related data source 'usersDS' does not contain related field 'regionsDS/id' for field 'regionId'. Treating as simple field.
    === 2011-09-21 16:01:00,634 [l0-2] WARN  BasicDataSource - [builtinApplication.usersDS_validate] Related data source 'usersDS' does not contain related field 'userGroupsDS/id' for field 'userGroupId'. Treating as simple field.
    === 2011-09-21 16:01:00,635 [l0-2] DEBUG ServerObject - [builtinApplication.usersDS_validate] Couldn't find a public method named: fetch on class: cz.bcom.smartrise.server.persistence.dmi.UsersDMI
    === 2011-09-21 16:01:00,635 [l0-2] DEBUG DataSourceDMI - [builtinApplication.usersDS_validate] DataSourceDMI: no public method name: fetch available on class: cz.bcom.smartrise.server.persistence.dmi.UsersDMI - defaulting to builtin operations.
    === 2011-09-21 16:01:00,635 [l0-2] DEBUG AppBase - [builtinApplication.usersDS_validate, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2011-09-21 16:01:00,635 [l0-2] DEBUG AppBase - [builtinApplication.usersDS_validate, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2011-09-21 16:01:00,635 [l0-2] DEBUG JPADataSource - [builtinApplication.usersDS_validate, builtinApplication.null] Creating EntityManager and starting transaction.
    === 2011-09-21 16:01:00,640 [l0-5] INFO  RequestContext - URL: '/smartrise/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
    === 2011-09-21 16:01:00,644 [l0-5] DEBUG XML - Parsed XML from (in memory stream): 2ms
    === 2011-09-21 16:01:00,649 [l0-5] DEBUG RPCManager - Processing 1 requests.
    === 2011-09-21 16:01:00,649 [l0-5] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'regionsDS/id' for field 'regionId'. Treating as simple field.
    === 2011-09-21 16:01:00,649 [l0-5] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'userGroupsDS/id' for field 'userGroupId'. Treating as simple field.
    === 2011-09-21 16:01:00,650 [l0-5] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            id:1
        },
        values:{
            userByCreatedByFirstName:"System",
            regionDisplayText:"92 - Bratislava Východ",
            regionId:1,
            icon:"ROLE_VIEWER",
            userGroupName:"ROLE_VIEWER",
            userGroupId:2,
            userByCreatedBySurname:"Admin",
            accountLocked:false,
            active:true,
            changePassword:false,
            checkUserIp:false,
            dateOfChange:null,
            dateOfCreation:new Date(1316440680000),
            defaultLanguage:null,
            email:"daniel.sterba@capacitypro.eu",
            failedLoginAttempts:0,
            id:1,
            lastFailedLogin:null,
            lastLoginErrorCode:null,
            lastSuccessfulLogin:new Date(1316613646000),
            login:"tester2",
            loginCount:16,
            loginDelay:0,
            middleName:"",
            name:"System",
            pwd:"763bbf73f4bcfd59131f5008601149c0",
            surname:"Admin",
            _selection_9:true
        },
        operationConfig:{
            dataSource:"usersDS",
            operationType:"update"
        },
        componentId:"isc_ValuesManager_0",
        appID:"builtinApplication",
        operation:"usersDS_update",
        oldValues:{
            userByCreatedByFirstName:"System",
            regionDisplayText:"92 - Bratislava Východ",
            regionId:1,
            icon:"ROLE_VIEWER",
            userGroupName:"ROLE_VIEWER",
            userGroupId:2,
            userByCreatedBySurname:"Admin",
            accountLocked:false,
            active:false,
            changePassword:false,
            checkUserIp:false,
            dateOfChange:null,
            dateOfCreation:new Date(1316440680000),
            defaultLanguage:null,
            email:"daniel.sterba@capacitypro.eu",
            failedLoginAttempts:0,
            id:1,
            lastFailedLogin:null,
            lastLoginErrorCode:null,
            lastSuccessfulLogin:new Date(1316613646000),
            login:"tester2",
            loginCount:16,
            loginDelay:0,
            middleName:"",
            name:"System",
            pwd:"763bbf73f4bcfd59131f5008601149c0",
            surname:"Admin",
            _selection_9:true
        }
    }
    === 2011-09-21 16:01:00,650 [l0-5] INFO  IDACall4Spring - IDACall - Performing 1 operation(s)
    === 2011-09-21 16:01:00,651 [l0-5] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'regionsDS/id' for field 'regionId'. Treating as simple field.
    === 2011-09-21 16:01:00,652 [l0-5] WARN  BasicDataSource - Related data source 'usersDS' does not contain related field 'userGroupsDS/id' for field 'userGroupId'. Treating as simple field.
    === 2011-09-21 16:01:00,652 [l0-5] DEBUG ServerObject - Couldn't find a public method named: fetch on class: cz.bcom.smartrise.server.persistence.dmi.UsersDMI
    === 2011-09-21 16:01:00,652 [l0-5] DEBUG DataSourceDMI - DataSourceDMI: no public method name: fetch available on class: cz.bcom.smartrise.server.persistence.dmi.UsersDMI - defaulting to builtin operations.
    === 2011-09-21 16:01:00,652 [l0-5] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2011-09-21 16:01:00,653 [l0-5] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2011-09-21 16:01:00,653 [l0-5] DEBUG JPADataSource - [builtinApplication.null] Creating EntityManager and starting transaction.
    === 2011-09-21 16:01:00,906 [l0-4] INFO  RequestContext - URL: '/smartrise/sc/system/reference/skin/images/opener_opened.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
    === 2011-09-21 16:01:00,907 [l0-7] INFO  RequestContext - URL: '/smartrise/sc/system/reference/skin/images/server_network_closed.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
    === 2011-09-21 16:01:00,907 [l0-4] INFO  Download - File C:/zdary/svn/smartRISE/RISE2/war/smartrise/sc/system/reference/skin/images/opener_opened.png not found, sending 404
    === 2011-09-21 16:01:00,907 [l0-7] INFO  Download - File C:/zdary/svn/smartRISE/RISE2/war/smartrise/sc/system/reference/skin/images/server_network_closed.png not found, sending 404
    === 2011-09-21 16:02:08,265 [l0-4] INFO  RequestContext - URL: '/smartrise/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
    === 2011-09-21 16:02:08,271 [l0-4] INFO  Compression - /smartrise/sc/IDACall: 81 -> 86 bytes
    === 2011-09-21 16:02:08,402 [l0-4] INFO  RequestContext - URL: '/smartrise/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
    Attached Files

    #2
    This is probably related to your earlier questions about custom EntityManagers - code you're not showing is causing some kind of hang. There's nothing we can do with this information yet (no way to reproduce, and unlikely to be a bug) but let us know if you can produce runnable code that demonstrates a framework issue.

    Comment


      #3
      Hi,

      I'm sorry for that. You were right, I drove my application into a dead lock.
      I converted all my DMI's to use EMF instead and now I got it to work.

      best regards,
      Zdary

      Comment

      Working...
      X