0

I have a jsf data table , the first column of which is a h:commandLink. The data that is loaded there , is kind of an id. The code looks like this :

<h:commandLink value="#{grease.greaseId}" rendered="#{MyBean.btnName == 'ending'}" id="greaseNo1" action="#{MyBean.greaseIdMonitored}" immediate="true">
     <f:param name="id" value="#{grease.greaseId}" />
</h:commandLink>

When it is rendered in html, a single cell appears like :

<script src="/grease/faces/javax.faces.resource/oamSubmit.js?ln=org.apache.myfaces" type="text/javascript">&lt;!--
//--&gt;</script><a id="myForm:dt1:0:greaseNo1" onclick="return myfaces.oam.submitForm('myForm','myForm:dt1:0:greaseNo1',null,[['id','mylot-256987']]);" href="#">mylot-256987</a>

Now the peculiar thing is , the command link is working fine during all scenarios, except when a load test is run. We have an IT environment. In normal circumstances, the data table gets loaded properly. However, when I test , while the load script runs, sometimes the command link gets rendered, sometimes it does not get rendered(especially during sorting or filtering). But all the other data table entries are getting rendered properly every time .

I am splitting my hairs trying to find , why it is behaving in such a manner. I am using RAD 8.5 and the application server is WAS 8.5 . The jsf implementation in question is IBM faces .

Can any one tell me why this is happening ? Any help will be greatly appreciated .

The Dark Knight
  • 5,455
  • 11
  • 54
  • 95
  • Are you sure `MyBean.btnName` value is `'ending'` while running these tests? – Luiggi Mendoza Dec 16 '13 at 15:20
  • How do i check that ? I tried to see the DOM in firebug, but there is no subsequent DOM anchor for that when the load test happens. The only other way is i can use a scriplet here and i can give a sys out and see , if the btn name is coming as pending . – The Dark Knight Dec 16 '13 at 15:22
  • 1
    Do not use scriptlets, instead use ``, or if you're using JSF 2 and Facelets just write `#{MyBean.btnName}` alone in your page. – Luiggi Mendoza Dec 16 '13 at 15:24
  • Just put a breakpoint on getter method. – BalusC Dec 16 '13 at 15:24
  • Okay, i can do that again , when the load test runs . But still, how is it possible that during a load test a specific part of an app will start behaving erratically, but behaves properly under normal circumstances ? I am not able to digest this part.. – The Dark Knight Dec 16 '13 at 15:25
  • @BalusC Break point will not work. Its not local env, rather its an IT env. So i do not have control over the code . – The Dark Knight Dec 16 '13 at 15:27
  • I.e. you can't do it remotely? Anyway, a logger can also do it. Will only take more time to examine afterwards. – BalusC Dec 16 '13 at 15:27
  • @BalusC yes, that's what i am thinking about doing .. – The Dark Knight Dec 16 '13 at 15:28
  • 1
    In any case, erratic behavior during stress testing indicates possibly threadunsafe code (incorrectly scoped data). I'd also check on that. That may be easier if you can read code fluently without the need to debug it. Verify if bean scopes are right (lot of starters abuse session scope for request/view scoped data), verify variable scopes as well (some starters abuse static scope for instance scoped data). – BalusC Dec 16 '13 at 15:30
  • @BalusC I have 2 beans and for both of them, I have given `managed-bean-scope` as `session`. Don't know how this can cause a problem . What do you mean by verification of variable, scope? I did not understand that one . – The Dark Knight Dec 16 '13 at 15:34
  • Okay, as I guessed ... Start here: http://stackoverflow.com/questions/7031885/how-to-choose-the-right-bean-scope/ – BalusC Dec 16 '13 at 15:35
  • @BalusC Thanks, having a look at that now . – The Dark Knight Dec 16 '13 at 15:36

0 Answers0