Topic
  • 11 replies
  • Latest Post - ‏2013-02-14T08:22:53Z by SystemAdmin
MaisnamVictor
MaisnamVictor
111 Posts

Pinned topic Ajax type-ahead executing really slow

‏2013-01-07T06:19:01Z |
Hi All,
I have implemented an ajax type ahead based on the best practices found in wiki/infocenter and also resources from the internet.

I have developed a sample type ahead ajax to retrieve list of user from the database(sample twx(s) can also be found on wiki). I am getting the desired result, however the execution is really slow, it takes 9-10 secs to execute. I also tried implementing combo on other input change ajax service but didn't face with any latency issue.
This happen even when I use a hardcoded list of String(s) for the result.
Has anybody faced any latency issue while implementing type ahead ajax?
Note: I am using 7.5.1.1 Adv Env, IE8.

Thxs
Updated on 2013-02-14T08:22:53Z at 2013-02-14T08:22:53Z by SystemAdmin
  • MaisnamVictor
    MaisnamVictor
    111 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-09T01:01:04Z  
    It's working perfectly in 7.5.1, however recently we upgraded to 7.5.1.1.

    I am not sure if the patch work is causing the problem.
    Does anyone has a take on this one?

    I will also add my findings.
    Thxs
    Victor
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-09T03:00:26Z  
    It's working perfectly in 7.5.1, however recently we upgraded to 7.5.1.1.

    I am not sure if the patch work is causing the problem.
    Does anyone has a take on this one?

    I will also add my findings.
    Thxs
    Victor
    After moving to 7.5.1.1, what we encountered is that "every 2nd Ajax call will fail". Other posts in this forumn confirmed that it's a bug in v.7.5.1.1

    Thanks,
    Vignesh
  • MaisnamVictor
    MaisnamVictor
    111 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-09T03:24:12Z  
    After moving to 7.5.1.1, what we encountered is that "every 2nd Ajax call will fail". Other posts in this forumn confirmed that it's a bug in v.7.5.1.1

    Thanks,
    Vignesh
    I second on Vikkee's comments.
  • MaisnamVictor
    MaisnamVictor
    111 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-09T05:38:39Z  
    After moving to 7.5.1.1, what we encountered is that "every 2nd Ajax call will fail". Other posts in this forumn confirmed that it's a bug in v.7.5.1.1

    Thanks,
    Vignesh
    Hi Vikkee,

    Any PMR number on the issue that you can recall?
    Thxs
    Victor
  • RhettWhaley
    RhettWhaley
    40 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-11T19:36:38Z  
    We are also facing issues with Ajax calls as soon as we upgraded to 7.5.1.1 Calls made using tw.coach.callService are performing poorly or failing outright.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-23T10:51:13Z  
    Hi Vikkee,

    Any PMR number on the issue that you can recall?
    Thxs
    Victor
    Victor,
    I don't know any exact PMR number on it. Is there a place (a support webpage) where we can search for PMR's?

    I figured out where the alternate requests are failing, and I wrote this fragment as a temporary fix to this bug.

    It basically overrides the existing method {i}callServiceImpl(){i} in {b}coach_designer.js{b} system file, re-submits every alternate request. So for the end user, the behavior will be like, AJAX is working all the time.

    
    var parameters; var http_request; var _MAX_RETRY_LIMIT = 30; var retry_count = 0; var callServiceImpl = function (url, params, callBack) 
    { 
    //if(console) console.log ("callServiceImpl | Custom Ajax invoked with:" + params); parameters = 
    "input=" + encodeURIComponent(params); http_request = 
    
    null; 
    
    if (window.XMLHttpRequest) 
    { 
    // Mozilla, Safari,... http_request = 
    
    new XMLHttpRequest(); 
    
    if (http_request.overrideMimeType) 
    { http_request.overrideMimeType(
    'text/xml'); 
    } 
    } 
    
    else 
    
    if (window.ActiveXObject) 
    { 
    // IE 
    
    try 
    { http_request = 
    
    new ActiveXObject(
    "Msxml2.XMLHTTP"); 
    } 
    
    catch (e) 
    { 
    
    try 
    { http_request = 
    
    new ActiveXObject(
    "Microsoft.XMLHTTP"); 
    } 
    
    catch (e) 
    {
    } 
    } 
    } 
    
    if (!http_request) 
    { alert(
    'Cannot create XMLHTTP instance'); 
    
    return 
    
    false; 
    }   http_request.onreadystatechange = function() 
    { 
    
    if (http_request.readyState == 4) 
    { 
    
    if (http_request.status == 200) 
    { var ret = 
    
    new Object(); var result; console.log(
    "Response: " + http_request.responseText); 
    
    if(http_request.responseText.search(
    'javax.servlet.ServletException') != -1) 
    { 
    
    if(retry_count <= _MAX_RETRY_LIMIT) 
    { retry_count++; 
    //console.log("Retrying (" + retry_count + ")"); callServiceImpl(url, params, callBack); 
    } 
    
    else
    { 
    //console.log("Max Retry limit reached, aborting call to avoid indefinite call-outs"); 
    
    return; 
    } 
    } 
    
    else
    { result = http_request.responseXML.getElementsByTagName(
    "output"); 
    
    if (window.XMLHttpRequest && window.ActiveXObject) 
    {
    // necessary for IE7 http_request.responseXML.load(http_request.responseBody); result = http_request.responseXML.getElementsByTagName(
    "output"); 
    } 
    
    for (var i = 0 ; i < result.length ; i++) 
    { var output = result[i]; var name = output.getAttribute(
    "name"); ret[name] = parseValues(output.firstChild, ret); 
    } callBack(ret); 
    } 
    } 
    
    else 
    { 
    // Error processing request. 
    } 
    } 
    }; http_request.open(
    'POST', url, 
    
    true); http_request.setRequestHeader(
    "Content-type", 
    "application/x-www-form-urlencoded"); 
    /* Commenting to avoid the javascript error: Refused to set unsafe header "Content-length" / Refused to set unsafe header "Connection" http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); */ http_request.send(parameters); 
    }
    


    Thanks,
    Vignesh
  • XFGX_Krishna_Mellamarthy
    3 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-23T21:12:55Z  
    After moving to 7.5.1.1, what we encountered is that "every 2nd Ajax call will fail". Other posts in this forumn confirmed that it's a bug in v.7.5.1.1

    Thanks,
    Vignesh
    Same issue. Every 2nd ajax calls fails and the environment is 7.5.1.1.
  • MaisnamVictor
    MaisnamVictor
    111 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-28T23:12:29Z  
    Same issue. Every 2nd ajax calls fails and the environment is 7.5.1.1.
    Thxs Vignesh for your suggestion.

    We really didn't want to touch the product core files so went ahead and raised a PMR with IBM.
    Victor
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-01-29T11:38:48Z  
    Thxs Vignesh for your suggestion.

    We really didn't want to touch the product core files so went ahead and raised a PMR with IBM.
    Victor
    Hi Victor,

    Any update response or fixes from IBM so far? We also are facing the same problem.
    Would be of Great Help if you could share it.

    Thanks,
    Pranay
  • ibmbpm751
    ibmbpm751
    44 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-02-04T19:31:47Z  
    Hello All,

    I have not tried this. but one thing comes to my mind that internally tw.coach.callService calls the below url
    var url = "/portal/jsp/callService.do?serviceName=" + service + "&snapshotId=" + snapshot;.
    So i think we can use dojo.xhrGet to get the data using the url above. I wll try this too. :))
    Thanks
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Ajax type-ahead executing really slow

    ‏2013-02-14T08:22:53Z  
    • ibmbpm751
    • ‏2013-02-04T19:31:47Z
    Hello All,

    I have not tried this. but one thing comes to my mind that internally tw.coach.callService calls the below url
    var url = "/portal/jsp/callService.do?serviceName=" + service + "&snapshotId=" + snapshot;.
    So i think we can use dojo.xhrGet to get the data using the url above. I wll try this too. :))
    Thanks
    Here's the solution:
    JR44617: Ajax services do not work consistently.
    http://www-01.ibm.com/support/docview.wss?uid=swg1JR44617