Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unwanted behavior: Action method being called several times

 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a managed bean that calls a session ejb which itself does a search. The problem is that it is supposed to retrieve a resultset ONCE and the displayed behavior is that it never stop doing so. It fetches the resultset SEVERAL TIMES.

Here is the managed bean and the method to look at is the performSearch method:



Here is the object request passed:



and here is the session ejb:



I just don't understand why it does so. The peformSearch should be executed ONCE only.

Here is my face config file:



Can anyone help?

Thanks in advance,

Julien.
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will probably get at least two searches happen due to JSF lifecycles:

- renderView phase (1st time you see the page)
- restoreView phase (when you execute another action)

But it depends on your how you are moving from one page/action to another.
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Daniel,
The problem is that it is executed 20 to 30 times instead of once...
Julien.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic