Hernand Azevedo commented on Bug WELD-1130

I have a similar problem. It seems like conversation is replicated only when is created among the other instances of the cluster.

I´ve been testing using 1 Apache Http Server + 2 instances in cluster of tomcat7 and the "weld-jsf-numberguess"(weld-2.0.3.Final) modified to use conversation scope.

The apache using:
<Proxy balancer://testcluster stickysession=JSESSIONID>

BalancerMember ajp://127.0.0.1:8019 route=node1 loadfactor=1
BalancerMember ajp://127.0.0.1:8029 route=node2 loadfactor=1
</Proxy>

Modify the class org.jboss.weld.examples.numberguess.Game to @ConversationScoped and add the method:

@Inject
Conversation conversation;

//Atribute used to test the state of conversation
private Integer testValue = 0 ;

public void beginConversation()
{
if (conversation.isTransient())

{ conversation.begin(); }

}

public void check() {

testValue = testValue + 1;

if (guess > number)

{ biggest = guess - 1; }

else if (guess < number)

{ smallest = guess + 1; }

else if (guess == number)

{ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!")); }

remainingGuesses--;
}

Modify the home.xhtml add the code :

<f:metadata>
<f:event type="preRenderView" listener="#

{game.beginConversation}

"/>
</f:metadata>

and

//Just for to see the state of this attribute being saved by the conversation
<h:outputText id="testValue" value="#

{game.testValue}

" />

// The scenario:

1- Open the project and one instance of the cluster will be called.
2- Update the values of the testValue by clicking some times the button "Guess"
3- Stop instance of the cluster that is being called until here.
4- click the button "Guess"

5- Result >> the value of "testValue" fall back to the firt value "1".
That leads me to think that: the only time the conversation is replicated is when is created.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
weld-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/weld-issues

Reply via email to