You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Stephan Frai <fa...@online.de> on 2008/03/18 10:10:19 UTC

Orchestra beginner question: conversation.flash behaves like request scope

Hello,

 

I am new to orchestra and just integrated it into my application.

Myfaces 1.2.2

Hibernate 3.2.5

Spring 2.0.4

 

I`m using plain Hibernate without JPA, so I took the integration provided at
Google.

 

Currently I am running into that problem that conversation.flash behaves
like request scope.

I have a 4 step workflow and one controller bean for that workflow:

 

<bean id="regUserDirectPlanningController"
class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"

              scope="conversation.flash" depends-on="reservationJSF">

            <property name="planningWorkflow" ref="regUserDirectPlanning"/>

            <property name="reservationData" ref="reservationFormBean"/>

            <property name="chainData" ref="timeChainJSF"/>

            <property name="reservationConfirmation" ref="reservationJSF"/>

            <property name="messageFormatter" ref="jsfMessageFormatter"/>

            <property name="resourceManager" ref="resourceManager"/>

            <!-- 

            <property name="calendarJSF" ref="calendarJSF"/>

             -->

            <property name="reservationType"
ref="simpleOrChainSelectionJSF"/>

            <property name="reservationFactory"
ref="reservationBeanFactory"/>

</bean>

 

The other beans that are referenced are either Singletons as they are
Business Objects, or they are also conversation scoped as they are JsfBeans.

 

My problem is, that for each step in my workflow a new empty
regUserDirectPlanningController is created and i lose the internal state.

In debugger I can see that the AOP proxies around the conversation scoped
beans are properly created, so I think it`s kind of an configuration
problem.

 

Does this problem sound familiar to anyone?

 

If needed I can provide more detailed infos about configuration.

 

 

Kind regards,

 

Stephan Frai

 


AW: AW: AW: Orchestra beginner question: conversation.flash behaves like request scope - Different solution

Posted by Stephan Frai <fa...@online.de>.
Hi,	

injecting as prototype did not work. I don`t know why, and I did not
investigate.

I found a different solution, because I did not want to use the
viewController, because when using @viewController I had the names of views
in my Java files.

So I decided to declare the multi-time used beans serval times in spring.
For each workflow the needed bean is declared once:

<bean id="timeChainJSF" class="com.playoli.timeperiod.jsf.TimeChainJSF"
scope="conversation.access"
	orchestra:conversationName="regUserDirectPlanning">
		
	<property name="beanFactory" ref="timePeriodBeanFactory" />
	...
</bean>
	
<bean id="ru_edit_timeChainJSF"
class="com.playoli.timeperiod.jsf.TimeChainJSF"
	scope="conversation.access"
	orchestra:conversationName="regUserReservationEditing">
		
	<property name="beanFactory" ref="timePeriodBeanFactory" />
	...
</bean>

The id got a prefix for the workflow.

The workflow controller now look like that:

<bean id="reservationEditingJSF"
class="com.playoli.ruplanning.jsf.ReservationEditingJSF"
scope="conversation.access" 
      orchestra:conversationName="regUserReservationEditing"> 
	...
	<property name="chainData" ref="ru_edit_timeChainJSF"/>
	...
</bean>

<bean id="regUserDirectPlanningController"
class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
	scope="conversation.access" 
	orchestra:conversationName="regUserDirectPlanning">
	...
	<property name="chainData" ref="timeChainJSF"/>
	...
</bean>

Each workflow has its own xhtml-Pages that include several jsp pages.
The jsp pages formerly referenced the jsf beans like "timeChainJSF".
These beans hold only values and do no persistence.

Now I use Facelets ui:param to inject the right timeChain-bean into the jsp
page:

DirectPlanning.xhtml:

<ui:include  src="/WEB-INF/pages/timeperiod/timeChainOverview.jsp">
  <ui:param name="reservationConfirmation"
value="#{regUserDirectPlanningController.chainData}"/>
</ui:include>

EditPlanning.xhtml:
<ui:include  src="/WEB-INF/pages/timeperiod/timeChainOverview.jsp">
  <ui:param name="reservationConfirmation"
value="#{reservationEditingJSF.chainData}"/>
</ui:include>

Exerpt of timeChainOverview.jsp:

...
<h:outputText
value="#{timeChainmessages['timechain_chain_daily_every_day']}"
rendered="#{reservationConfirmation.workDayOnly=='false'}"/>
...

Using this approach I am able to use the same jsps in different worklows,
while the jsps reference the correctly scoped beans of my workflow.


Regards,

Stephan


-----Ursprüngliche Nachricht-----
Von: Mario Ivankovits [mailto:mario@ops.co.at] 
Gesendet: Dienstag, 18. März 2008 14:28
An: MyFaces Discussion
Betreff: Re: AW: AW: Orchestra beginner question: conversation.flash behaves
like request scope

Mario Ivankovits schrieb:
> Are you using persistence from within the timeChainJSF bean?
> If not, you can inject the bean into your controller bean and use it
> through your controller.
> This is the solution I'd prefer.
>   
Should elaborate a little bit more about what I meant here.

If possible, use the TimeChainJSF bean as prototype and inject that into
your controller bean which has a conversation scope.

That way, each controller bean will get its own TimeChainJSF bean which
you'll be able to access through the controller than.

Hope that makes it a little bit clearer.

Ciao,
Mario



Re: AW: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Mario Ivankovits <ma...@ops.co.at>.
Mario Ivankovits schrieb:
> Are you using persistence from within the timeChainJSF bean?
> If not, you can inject the bean into your controller bean and use it
> through your controller.
> This is the solution I'd prefer.
>   
Should elaborate a little bit more about what I meant here.

If possible, use the TimeChainJSF bean as prototype and inject that into
your controller bean which has a conversation scope.

That way, each controller bean will get its own TimeChainJSF bean which
you'll be able to access through the controller than.

Hope that makes it a little bit clearer.

Ciao,
Mario


Re: AW: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
>> Or do I have to define two separate beans in Spring:
>>
>> <bean id="timeChainJSF_1" class="com.playoli.timeperiod.jsf.TimeChainJSF"
>> <bean id="timeChainJSF_2" class="com.playoli.timeperiod.jsf.TimeChainJSF"
>>   
>>     
>
> You need to use the "two separate bean definitions" approach. That gives
> your EL expressions the ability to say "I want the instance from
> conversation X" by referencing a different name. I would suggest names
>   
Are you using persistence from within the timeChainJSF bean?
If not, you can inject the bean into your controller bean and use it
through your controller.
This is the solution I'd prefer.

And last but not least (I know, Simon did not like it ;-) ), if you
follow the ViewController concept (easiest using the @ViewController
annotation), you are able to use the special "viewController" scope for
such beans which means: For this bean use the same scope and
conversation as your view controller does.
So you have to define it only once, but get two different instances for
each conversation.

Ciao,
Mario


Re: AW: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Stephan Frai schrieb:
> Hi Simon,
>
> thanks for your help.
> After I had given the conversation a name, everything worked fine.
>
> I`ve got a last question:
> May I specify more than one conversationName per bean?
> Because I`m using the same bean in different workflows.
>
> E.g:
>
> <bean id="timeChainJSF" class="com.playoli.timeperiod.jsf.TimeChainJSF"
> scope="conversation.access"
>  orchestra:conversationName="regUserDirectPlanning,regUserRequestPlanning">
> 	<property name="beanFactory" ref="timePeriodBeanFactory" />
> 	<property name="timePeriodValidation" ref="timePeriodValidation"/>
> </bean>
>
> Or do I have to define two separate beans in Spring:
>
> <bean id="timeChainJSF_1" class="com.playoli.timeperiod.jsf.TimeChainJSF"
> scope="conversation.access"
> 	 orchestra:conversationName="regUserDirectPlanning">
> 	<property name="beanFactory" ref="timePeriodBeanFactory" />
> 	<property name="timePeriodValidation" ref="timePeriodValidation"/>
> </bean>
>
> <bean id="timeChainJSF_2" class="com.playoli.timeperiod.jsf.TimeChainJSF"
> scope="conversation.access"
> 	 orchestra:conversationName="regUserRequestPlanning">
> 	<property name="beanFactory" ref="timePeriodBeanFactory" />
> 	<property name="timePeriodValidation" ref="timePeriodValidation"/>
> </bean>
>   
It's good to hear it's working for you now.

You need to use the "two separate bean definitions" approach. That gives
your EL expressions the ability to say "I want the instance from
conversation X" by referencing a different name. I would suggest names
   requestPlanningTimeChainJSF
   directPlanningTimeChainJSF
rather than _1 and _2 to reflect this [1].

I can't currently think of another way of doing this. If the EL
expression just says "timeChainJSF", and the beandef has multiple
conversations associated with it, then which conversation would
Orchestra choose? For some other conversation frameworks this is not an
issue; they only ever have one active conversation at a time. But
Orchestra is trying to avoid that assumption. We think that is more
powerful - but it is sometimes a little less convenient.

[1] Note that Spring allows a bean definition to specify a "parent"
definition to inherit settings from. So you can avoid some duplication
here by having one "abstract" definition that both the others reference.

Regards, Simon


AW: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Stephan Frai <fa...@online.de>.
Hi Simon,

thanks for your help.
After I had given the conversation a name, everything worked fine.

I`ve got a last question:
May I specify more than one conversationName per bean?
Because I`m using the same bean in different workflows.

E.g:

<bean id="timeChainJSF" class="com.playoli.timeperiod.jsf.TimeChainJSF"
scope="conversation.access"
 orchestra:conversationName="regUserDirectPlanning,regUserRequestPlanning">
	<property name="beanFactory" ref="timePeriodBeanFactory" />
	<property name="timePeriodValidation" ref="timePeriodValidation"/>
</bean>

Or do I have to define two separate beans in Spring:

<bean id="timeChainJSF_1" class="com.playoli.timeperiod.jsf.TimeChainJSF"
scope="conversation.access"
	 orchestra:conversationName="regUserDirectPlanning">
	<property name="beanFactory" ref="timePeriodBeanFactory" />
	<property name="timePeriodValidation" ref="timePeriodValidation"/>
</bean>

<bean id="timeChainJSF_2" class="com.playoli.timeperiod.jsf.TimeChainJSF"
scope="conversation.access"
	 orchestra:conversationName="regUserRequestPlanning">
	<property name="beanFactory" ref="timePeriodBeanFactory" />
	<property name="timePeriodValidation" ref="timePeriodValidation"/>
</bean>


Regards,

Stephan

-----Ursprüngliche Nachricht-----
Von: simon.kitching@chello.at [mailto:simon.kitching@chello.at] 
Gesendet: Dienstag, 18. März 2008 12:01
An: MyFaces Discussion
Betreff: Re: AW: Orchestra beginner question: conversation.flash behaves
like request scope

Hi Stephan,

I'll need to ask Matthias to update his example ;-)

Everything looks ok in the logs. It just looks to me like your page is
not actually referencing anything from your controller bean.

Orchestra is assuming that in page regUserDirectPlanningController,
there is something that pulls data from the
regUserDirectPlanningController class during the render phase. Is this
not the case for your page? I would expect that somewhere in your page
you have  a component that accesses
   #{regUserDirectPlanningController.reservationData}
or some other property on your controller bean. That access is how
Orchestra knows that the bean is still in use.

A "pure controller" bean, which handles postbacks but does not serve any
resources at all during the render phase is possible, though I would not
think it common. If your class is indeed a "pure controller" then you
can add a dummy component to the page, eg
    <h:outputText rendered="#{regUserDirectPlanningController.class ==
null}"/>
Of course this rendered expression will never be true, so this will not
affect the page output in any way, but just evaluating the rendered
expression will tell Orchestra that the bean is still in use.

However:  do the beans
  regUserDirectPlanningController
  reservationJSF
  simpleOrChainSelectionJSF
  etc
all have the same lifetime, ie they should all be discarded together? If
so, then what you should do is add attribute
  conversationName="regUser"
(or whatever name you want to choose) to each of the Spring bean
declarations. Then they all live in the same conversation. One effect is
that a reference to *any* of those beans will keep *all* of them alive
(because the common conversation is in use). Only when a render phase
accesses none of them will the conversation be discarded.

Regards, Simon


Stephan Frai schrieb:
> Hello Simon,
>
> thank you for answering.
>
> I saw the old "flash" example here: 
> http://myfaces-orchestra-goodies.googlecode.com/svn/trunk
>
> After I turned on logging I got the following logger output:
>
> 18 Mrz 2008 11:09:03,156 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation regUserDirectPlanningController after
> rendering view /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288]
destroy
> conversation:regUserDirectPlanningController
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
> clearing accessed conversation reservationFormBean after rendering view
> /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation reservationJSF after rendering view
> /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288]
destroy
> conversation:reservationJSF
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
> clearing accessed conversation simpleOrChainSelectionJSF after rendering
> view /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation timeChainJSF after rendering view
> /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288]
destroy
> conversation:timeChainJSF
> 18 Mrz 2008 11:09:03,171 DEBUG [OrchestraFacesContextFactory$1: 129]
Running
> release
> 18 Mrz 2008 11:09:03,171 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69]
Ending
> request
>
>
> 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation regUserDirectPlanningController after
> rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288]
destroy
> conversation:regUserDirectPlanningController
> 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation reservationFormBean after rendering
view
> /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288]
destroy
> conversation:reservationFormBean
> 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
> clearing accessed conversation reservationJSF after rendering view
> /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation simpleOrChainSelectionJSF after
> rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,656 DEBUG [stra.conversation.Conversation: 288]
destroy
> conversation:simpleOrChainSelectionJSF
> 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 129]
Running
> release
> 18 Mrz 2008 11:13:15,656 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69]
Ending
> request
> 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 138]
Release
> completed
>
>
> As you can see, the converstion is destroyed after every rendered view of
> the workflow.
> Do I have to use the ViewController annotation?
>
>
> Greetings,
>
> Stephan
>
>
> -----Ursprüngliche Nachricht-----
> Von: simon.kitching@chello.at [mailto:simon.kitching@chello.at] 
> Gesendet: Dienstag, 18. März 2008 10:34
> An: MyFaces Discussion
> Betreff: Re: Orchestra beginner question: conversation.flash behaves like
> request scope
>
> Stephan Frai schrieb:
>   
>> Hello,
>>
>>  
>>
>> I am new to orchestra and just integrated it into my application.
>>
>> Myfaces 1.2.2
>>
>> Hibernate 3.2.5
>>
>> Spring 2.0.4
>>
>>  
>>
>> I`m using plain Hibernate without JPA, so I took the integration
>> provided at Google.
>>
>>  
>>
>> Currently I am running into that problem that conversation.flash
>> behaves like request scope.
>>
>> I have a 4 step workflow and one controller bean for that workflow:
>>
>>  
>>
>> <bean id="regUserDirectPlanningController"
>> class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
>>
>>               scope="conversation.flash" depends-on="reservationJSF">
>>
>>             <property name="planningWorkflow"
>> ref="regUserDirectPlanning"/>
>>
>>             <property name="reservationData" ref="reservationFormBean"/>
>>
>>             <property name="chainData" ref="timeChainJSF"/>
>>
>>             <property name="reservationConfirmation"
>> ref="reservationJSF"/>
>>
>>             <property name="messageFormatter" ref="jsfMessageFormatter"/>
>>
>>             <property name="resourceManager" ref="resourceManager"/>
>>
>>             <!--
>>
>>             <property name="calendarJSF" ref="calendarJSF"/>
>>
>>              -->
>>
>>             <property name="reservationType"
>> ref="simpleOrChainSelectionJSF"/>
>>
>>             <property name="reservationFactory"
>> ref="reservationBeanFactory"/>
>>
>> </bean>
>>
>>  
>>
>> The other beans that are referenced are either Singletons as they are
>> Business Objects, or they are also conversation scoped as they are
>> JsfBeans.
>>
>>  
>>
>> My problem is, that for each step in my workflow a new empty
>> regUserDirectPlanningController is created and i lose the internal state.
>>
>> In debugger I can see that the AOP proxies around the conversation
>> scoped beans are properly created, so I think it`s kind of an
>> configuration problem.
>>
>>  
>>
>> Does this problem sound familiar to anyone?
>>
>>  
>>
>> If needed I can provide more detailed infos about configuration.
>>
>>     
> You could try enabling debug level for the logging category
>  
>
"org.apache.myfaces.orchestra.conversation.jsf.OrchestraAccessScopePhaseList
> ener".
>
> This is the class that is responsible for discarding access-scope
> (formerly called "flash" scope) beans.
>
> By the way, the name "flash" is now deprecated; "access" is the
> preferred term. The old name should still work, but AFAIK all the
> examples have been updated to the new name. Where did you see the old one?
>
> Regards, Simon
>
>
>
>   



Re: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
>>  >  I'll need to ask Matthias to update his example ;-)
>>
>>  that is not mine. Mine is kind of up-to-date (facesgoodies)
>>     
>
> it is mario's project:
> http://code.google.com/p/myfaces-orchestra-goodies/
>   
I totally forgot that there are examples too :-)
I am getting old ....

Ciao,
Mario


Re: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Matthias Wessendorf <ma...@apache.org>.
Hi,

On Tue, Mar 18, 2008 at 9:38 AM, Matthias Wessendorf <ma...@apache.org> wrote:
> Hi,
>
>
>  On Tue, Mar 18, 2008 at 7:01 AM, simon.kitching@chello.at
>  <si...@chello.at> wrote:
>  > Hi Stephan,
>  >
>  >  I'll need to ask Matthias to update his example ;-)
>
>  that is not mine. Mine is kind of up-to-date (facesgoodies)

it is mario's project:
http://code.google.com/p/myfaces-orchestra-goodies/

>
>  -M
>
>
>
>  >
>  >  Everything looks ok in the logs. It just looks to me like your page is
>  >  not actually referencing anything from your controller bean.
>  >
>  >  Orchestra is assuming that in page regUserDirectPlanningController,
>  >  there is something that pulls data from the
>  >  regUserDirectPlanningController class during the render phase. Is this
>  >  not the case for your page? I would expect that somewhere in your page
>  >  you have  a component that accesses
>  >    #{regUserDirectPlanningController.reservationData}
>  >  or some other property on your controller bean. That access is how
>  >  Orchestra knows that the bean is still in use.
>  >
>  >  A "pure controller" bean, which handles postbacks but does not serve any
>  >  resources at all during the render phase is possible, though I would not
>  >  think it common. If your class is indeed a "pure controller" then you
>  >  can add a dummy component to the page, eg
>  >     <h:outputText rendered="#{regUserDirectPlanningController.class ==
>  >  null}"/>
>  >  Of course this rendered expression will never be true, so this will not
>  >  affect the page output in any way, but just evaluating the rendered
>  >  expression will tell Orchestra that the bean is still in use.
>  >
>  >  However:  do the beans
>  >   regUserDirectPlanningController
>  >   reservationJSF
>  >   simpleOrChainSelectionJSF
>  >   etc
>  >  all have the same lifetime, ie they should all be discarded together? If
>  >  so, then what you should do is add attribute
>  >   conversationName="regUser"
>  >  (or whatever name you want to choose) to each of the Spring bean
>  >  declarations. Then they all live in the same conversation. One effect is
>  >  that a reference to *any* of those beans will keep *all* of them alive
>  >  (because the common conversation is in use). Only when a render phase
>  >  accesses none of them will the conversation be discarded.
>  >
>  >  Regards, Simon
>  >
>  >
>  >  Stephan Frai schrieb:
>  >
>  >
>  > > Hello Simon,
>  >  >
>  >  > thank you for answering.
>  >  >
>  >  > I saw the old "flash" example here:
>  >  > http://myfaces-orchestra-goodies.googlecode.com/svn/trunk
>  >  >
>  >  > After I turned on logging I got the following logger output:
>  >  >
>  >  > 18 Mrz 2008 11:09:03,156 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  >  > Clearing access-scoped conversation regUserDirectPlanningController after
>  >  > rendering view /pages/ruplanning/regUserDirectPlanning.xhtml
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
>  >  > conversation:regUserDirectPlanningController
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
>  >  > clearing accessed conversation reservationFormBean after rendering view
>  >  > /pages/ruplanning/regUserDirectPlanning.xhtml
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  >  > Clearing access-scoped conversation reservationJSF after rendering view
>  >  > /pages/ruplanning/regUserDirectPlanning.xhtml
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
>  >  > conversation:reservationJSF
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
>  >  > clearing accessed conversation simpleOrChainSelectionJSF after rendering
>  >  > view /pages/ruplanning/regUserDirectPlanning.xhtml
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  >  > Clearing access-scoped conversation timeChainJSF after rendering view
>  >  > /pages/ruplanning/regUserDirectPlanning.xhtml
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
>  >  > conversation:timeChainJSF
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [OrchestraFacesContextFactory$1: 129] Running
>  >  > release
>  >  > 18 Mrz 2008 11:09:03,171 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
>  >  > request
>  >  >
>  >  >
>  >  > 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  >  > Clearing access-scoped conversation regUserDirectPlanningController after
>  >  > rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  >  > 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
>  >  > conversation:regUserDirectPlanningController
>  >  > 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  >  > Clearing access-scoped conversation reservationFormBean after rendering view
>  >  > /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  >  > 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
>  >  > conversation:reservationFormBean
>  >  > 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
>  >  > clearing accessed conversation reservationJSF after rendering view
>  >  > /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  >  > 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  >  > Clearing access-scoped conversation simpleOrChainSelectionJSF after
>  >  > rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  >  > 18 Mrz 2008 11:13:15,656 DEBUG [stra.conversation.Conversation: 288] destroy
>  >  > conversation:simpleOrChainSelectionJSF
>  >  > 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 129] Running
>  >  > release
>  >  > 18 Mrz 2008 11:13:15,656 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
>  >  > request
>  >  > 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 138] Release
>  >  > completed
>  >  >
>  >  >
>  >  > As you can see, the converstion is destroyed after every rendered view of
>  >  > the workflow.
>  >  > Do I have to use the ViewController annotation?
>  >  >
>  >  >
>  >  > Greetings,
>  >  >
>  >  > Stephan
>  >  >
>  >  >
>  >  > -----Ursprüngliche Nachricht-----
>  >  > Von: simon.kitching@chello.at [mailto:simon.kitching@chello.at]
>  >  > Gesendet: Dienstag, 18. März 2008 10:34
>  >  > An: MyFaces Discussion
>  >  > Betreff: Re: Orchestra beginner question: conversation.flash behaves like
>  >  > request scope
>  >  >
>  >  > Stephan Frai schrieb:
>  >  >
>  >  >> Hello,
>  >  >>
>  >  >>
>  >  >>
>  >  >> I am new to orchestra and just integrated it into my application.
>  >  >>
>  >  >> Myfaces 1.2.2
>  >  >>
>  >  >> Hibernate 3.2.5
>  >  >>
>  >  >> Spring 2.0.4
>  >  >>
>  >  >>
>  >  >>
>  >  >> I`m using plain Hibernate without JPA, so I took the integration
>  >  >> provided at Google.
>  >  >>
>  >  >>
>  >  >>
>  >  >> Currently I am running into that problem that conversation.flash
>  >  >> behaves like request scope.
>  >  >>
>  >  >> I have a 4 step workflow and one controller bean for that workflow:
>  >  >>
>  >  >>
>  >  >>
>  >  >> <bean id="regUserDirectPlanningController"
>  >  >> class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
>  >  >>
>  >  >>               scope="conversation.flash" depends-on="reservationJSF">
>  >  >>
>  >  >>             <property name="planningWorkflow"
>  >  >> ref="regUserDirectPlanning"/>
>  >  >>
>  >  >>             <property name="reservationData" ref="reservationFormBean"/>
>  >  >>
>  >  >>             <property name="chainData" ref="timeChainJSF"/>
>  >  >>
>  >  >>             <property name="reservationConfirmation"
>  >  >> ref="reservationJSF"/>
>  >  >>
>  >  >>             <property name="messageFormatter" ref="jsfMessageFormatter"/>
>  >  >>
>  >  >>             <property name="resourceManager" ref="resourceManager"/>
>  >  >>
>  >  >>             <!--
>  >  >>
>  >  >>             <property name="calendarJSF" ref="calendarJSF"/>
>  >  >>
>  >  >>              -->
>  >  >>
>  >  >>             <property name="reservationType"
>  >  >> ref="simpleOrChainSelectionJSF"/>
>  >  >>
>  >  >>             <property name="reservationFactory"
>  >  >> ref="reservationBeanFactory"/>
>  >  >>
>  >  >> </bean>
>  >  >>
>  >  >>
>  >  >>
>  >  >> The other beans that are referenced are either Singletons as they are
>  >  >> Business Objects, or they are also conversation scoped as they are
>  >  >> JsfBeans.
>  >  >>
>  >  >>
>  >  >>
>  >  >> My problem is, that for each step in my workflow a new empty
>  >  >> regUserDirectPlanningController is created and i lose the internal state.
>  >  >>
>  >  >> In debugger I can see that the AOP proxies around the conversation
>  >  >> scoped beans are properly created, so I think it`s kind of an
>  >  >> configuration problem.
>  >  >>
>  >  >>
>  >  >>
>  >  >> Does this problem sound familiar to anyone?
>  >  >>
>  >  >>
>  >  >>
>  >  >> If needed I can provide more detailed infos about configuration.
>  >  >>
>  >  >>
>  >  > You could try enabling debug level for the logging category
>  >  >
>  >  > "org.apache.myfaces.orchestra.conversation.jsf.OrchestraAccessScopePhaseList
>  >  > ener".
>  >  >
>  >  > This is the class that is responsible for discarding access-scope
>  >  > (formerly called "flash" scope) beans.
>  >  >
>  >  > By the way, the name "flash" is now deprecated; "access" is the
>  >  > preferred term. The old name should still work, but AFAIK all the
>  >  > examples have been updated to the new name. Where did you see the old one?
>  >  >
>  >  > Regards, Simon
>  >  >
>  >  >
>  >  >
>  >  >
>  >
>  >
>
>
>
>  --
>  Matthias Wessendorf
>
>  further stuff:
>  blog: http://matthiaswessendorf.wordpress.com/
>  sessions: http://www.slideshare.net/mwessendorf
>  mail: matzew-at-apache-dot-org
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Re: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Matthias Wessendorf <ma...@apache.org>.
Hi,

On Tue, Mar 18, 2008 at 7:01 AM, simon.kitching@chello.at
<si...@chello.at> wrote:
> Hi Stephan,
>
>  I'll need to ask Matthias to update his example ;-)

that is not mine. Mine is kind of up-to-date (facesgoodies)

-M

>
>  Everything looks ok in the logs. It just looks to me like your page is
>  not actually referencing anything from your controller bean.
>
>  Orchestra is assuming that in page regUserDirectPlanningController,
>  there is something that pulls data from the
>  regUserDirectPlanningController class during the render phase. Is this
>  not the case for your page? I would expect that somewhere in your page
>  you have  a component that accesses
>    #{regUserDirectPlanningController.reservationData}
>  or some other property on your controller bean. That access is how
>  Orchestra knows that the bean is still in use.
>
>  A "pure controller" bean, which handles postbacks but does not serve any
>  resources at all during the render phase is possible, though I would not
>  think it common. If your class is indeed a "pure controller" then you
>  can add a dummy component to the page, eg
>     <h:outputText rendered="#{regUserDirectPlanningController.class ==
>  null}"/>
>  Of course this rendered expression will never be true, so this will not
>  affect the page output in any way, but just evaluating the rendered
>  expression will tell Orchestra that the bean is still in use.
>
>  However:  do the beans
>   regUserDirectPlanningController
>   reservationJSF
>   simpleOrChainSelectionJSF
>   etc
>  all have the same lifetime, ie they should all be discarded together? If
>  so, then what you should do is add attribute
>   conversationName="regUser"
>  (or whatever name you want to choose) to each of the Spring bean
>  declarations. Then they all live in the same conversation. One effect is
>  that a reference to *any* of those beans will keep *all* of them alive
>  (because the common conversation is in use). Only when a render phase
>  accesses none of them will the conversation be discarded.
>
>  Regards, Simon
>
>
>  Stephan Frai schrieb:
>
>
> > Hello Simon,
>  >
>  > thank you for answering.
>  >
>  > I saw the old "flash" example here:
>  > http://myfaces-orchestra-goodies.googlecode.com/svn/trunk
>  >
>  > After I turned on logging I got the following logger output:
>  >
>  > 18 Mrz 2008 11:09:03,156 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  > Clearing access-scoped conversation regUserDirectPlanningController after
>  > rendering view /pages/ruplanning/regUserDirectPlanning.xhtml
>  > 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
>  > conversation:regUserDirectPlanningController
>  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
>  > clearing accessed conversation reservationFormBean after rendering view
>  > /pages/ruplanning/regUserDirectPlanning.xhtml
>  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  > Clearing access-scoped conversation reservationJSF after rendering view
>  > /pages/ruplanning/regUserDirectPlanning.xhtml
>  > 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
>  > conversation:reservationJSF
>  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
>  > clearing accessed conversation simpleOrChainSelectionJSF after rendering
>  > view /pages/ruplanning/regUserDirectPlanning.xhtml
>  > 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  > Clearing access-scoped conversation timeChainJSF after rendering view
>  > /pages/ruplanning/regUserDirectPlanning.xhtml
>  > 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
>  > conversation:timeChainJSF
>  > 18 Mrz 2008 11:09:03,171 DEBUG [OrchestraFacesContextFactory$1: 129] Running
>  > release
>  > 18 Mrz 2008 11:09:03,171 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
>  > request
>  >
>  >
>  > 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  > Clearing access-scoped conversation regUserDirectPlanningController after
>  > rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  > 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
>  > conversation:regUserDirectPlanningController
>  > 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  > Clearing access-scoped conversation reservationFormBean after rendering view
>  > /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  > 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
>  > conversation:reservationFormBean
>  > 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
>  > clearing accessed conversation reservationJSF after rendering view
>  > /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  > 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 161]
>  > Clearing access-scoped conversation simpleOrChainSelectionJSF after
>  > rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
>  > 18 Mrz 2008 11:13:15,656 DEBUG [stra.conversation.Conversation: 288] destroy
>  > conversation:simpleOrChainSelectionJSF
>  > 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 129] Running
>  > release
>  > 18 Mrz 2008 11:13:15,656 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
>  > request
>  > 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 138] Release
>  > completed
>  >
>  >
>  > As you can see, the converstion is destroyed after every rendered view of
>  > the workflow.
>  > Do I have to use the ViewController annotation?
>  >
>  >
>  > Greetings,
>  >
>  > Stephan
>  >
>  >
>  > -----Ursprüngliche Nachricht-----
>  > Von: simon.kitching@chello.at [mailto:simon.kitching@chello.at]
>  > Gesendet: Dienstag, 18. März 2008 10:34
>  > An: MyFaces Discussion
>  > Betreff: Re: Orchestra beginner question: conversation.flash behaves like
>  > request scope
>  >
>  > Stephan Frai schrieb:
>  >
>  >> Hello,
>  >>
>  >>
>  >>
>  >> I am new to orchestra and just integrated it into my application.
>  >>
>  >> Myfaces 1.2.2
>  >>
>  >> Hibernate 3.2.5
>  >>
>  >> Spring 2.0.4
>  >>
>  >>
>  >>
>  >> I`m using plain Hibernate without JPA, so I took the integration
>  >> provided at Google.
>  >>
>  >>
>  >>
>  >> Currently I am running into that problem that conversation.flash
>  >> behaves like request scope.
>  >>
>  >> I have a 4 step workflow and one controller bean for that workflow:
>  >>
>  >>
>  >>
>  >> <bean id="regUserDirectPlanningController"
>  >> class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
>  >>
>  >>               scope="conversation.flash" depends-on="reservationJSF">
>  >>
>  >>             <property name="planningWorkflow"
>  >> ref="regUserDirectPlanning"/>
>  >>
>  >>             <property name="reservationData" ref="reservationFormBean"/>
>  >>
>  >>             <property name="chainData" ref="timeChainJSF"/>
>  >>
>  >>             <property name="reservationConfirmation"
>  >> ref="reservationJSF"/>
>  >>
>  >>             <property name="messageFormatter" ref="jsfMessageFormatter"/>
>  >>
>  >>             <property name="resourceManager" ref="resourceManager"/>
>  >>
>  >>             <!--
>  >>
>  >>             <property name="calendarJSF" ref="calendarJSF"/>
>  >>
>  >>              -->
>  >>
>  >>             <property name="reservationType"
>  >> ref="simpleOrChainSelectionJSF"/>
>  >>
>  >>             <property name="reservationFactory"
>  >> ref="reservationBeanFactory"/>
>  >>
>  >> </bean>
>  >>
>  >>
>  >>
>  >> The other beans that are referenced are either Singletons as they are
>  >> Business Objects, or they are also conversation scoped as they are
>  >> JsfBeans.
>  >>
>  >>
>  >>
>  >> My problem is, that for each step in my workflow a new empty
>  >> regUserDirectPlanningController is created and i lose the internal state.
>  >>
>  >> In debugger I can see that the AOP proxies around the conversation
>  >> scoped beans are properly created, so I think it`s kind of an
>  >> configuration problem.
>  >>
>  >>
>  >>
>  >> Does this problem sound familiar to anyone?
>  >>
>  >>
>  >>
>  >> If needed I can provide more detailed infos about configuration.
>  >>
>  >>
>  > You could try enabling debug level for the logging category
>  >
>  > "org.apache.myfaces.orchestra.conversation.jsf.OrchestraAccessScopePhaseList
>  > ener".
>  >
>  > This is the class that is responsible for discarding access-scope
>  > (formerly called "flash" scope) beans.
>  >
>  > By the way, the name "flash" is now deprecated; "access" is the
>  > preferred term. The old name should still work, but AFAIK all the
>  > examples have been updated to the new name. Where did you see the old one?
>  >
>  > Regards, Simon
>  >
>  >
>  >
>  >
>
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Re: AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Hi Stephan,

I'll need to ask Matthias to update his example ;-)

Everything looks ok in the logs. It just looks to me like your page is
not actually referencing anything from your controller bean.

Orchestra is assuming that in page regUserDirectPlanningController,
there is something that pulls data from the
regUserDirectPlanningController class during the render phase. Is this
not the case for your page? I would expect that somewhere in your page
you have  a component that accesses
   #{regUserDirectPlanningController.reservationData}
or some other property on your controller bean. That access is how
Orchestra knows that the bean is still in use.

A "pure controller" bean, which handles postbacks but does not serve any
resources at all during the render phase is possible, though I would not
think it common. If your class is indeed a "pure controller" then you
can add a dummy component to the page, eg
    <h:outputText rendered="#{regUserDirectPlanningController.class ==
null}"/>
Of course this rendered expression will never be true, so this will not
affect the page output in any way, but just evaluating the rendered
expression will tell Orchestra that the bean is still in use.

However:  do the beans
  regUserDirectPlanningController
  reservationJSF
  simpleOrChainSelectionJSF
  etc
all have the same lifetime, ie they should all be discarded together? If
so, then what you should do is add attribute
  conversationName="regUser"
(or whatever name you want to choose) to each of the Spring bean
declarations. Then they all live in the same conversation. One effect is
that a reference to *any* of those beans will keep *all* of them alive
(because the common conversation is in use). Only when a render phase
accesses none of them will the conversation be discarded.

Regards, Simon


Stephan Frai schrieb:
> Hello Simon,
>
> thank you for answering.
>
> I saw the old "flash" example here: 
> http://myfaces-orchestra-goodies.googlecode.com/svn/trunk
>
> After I turned on logging I got the following logger output:
>
> 18 Mrz 2008 11:09:03,156 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation regUserDirectPlanningController after
> rendering view /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
> conversation:regUserDirectPlanningController
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
> clearing accessed conversation reservationFormBean after rendering view
> /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation reservationJSF after rendering view
> /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
> conversation:reservationJSF
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
> clearing accessed conversation simpleOrChainSelectionJSF after rendering
> view /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation timeChainJSF after rendering view
> /pages/ruplanning/regUserDirectPlanning.xhtml
> 18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
> conversation:timeChainJSF
> 18 Mrz 2008 11:09:03,171 DEBUG [OrchestraFacesContextFactory$1: 129] Running
> release
> 18 Mrz 2008 11:09:03,171 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
> request
>
>
> 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation regUserDirectPlanningController after
> rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
> conversation:regUserDirectPlanningController
> 18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation reservationFormBean after rendering view
> /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
> conversation:reservationFormBean
> 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
> clearing accessed conversation reservationJSF after rendering view
> /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 161]
> Clearing access-scoped conversation simpleOrChainSelectionJSF after
> rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
> 18 Mrz 2008 11:13:15,656 DEBUG [stra.conversation.Conversation: 288] destroy
> conversation:simpleOrChainSelectionJSF
> 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 129] Running
> release
> 18 Mrz 2008 11:13:15,656 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
> request
> 18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 138] Release
> completed
>
>
> As you can see, the converstion is destroyed after every rendered view of
> the workflow.
> Do I have to use the ViewController annotation?
>
>
> Greetings,
>
> Stephan
>
>
> -----Ursprüngliche Nachricht-----
> Von: simon.kitching@chello.at [mailto:simon.kitching@chello.at] 
> Gesendet: Dienstag, 18. März 2008 10:34
> An: MyFaces Discussion
> Betreff: Re: Orchestra beginner question: conversation.flash behaves like
> request scope
>
> Stephan Frai schrieb:
>   
>> Hello,
>>
>>  
>>
>> I am new to orchestra and just integrated it into my application.
>>
>> Myfaces 1.2.2
>>
>> Hibernate 3.2.5
>>
>> Spring 2.0.4
>>
>>  
>>
>> I`m using plain Hibernate without JPA, so I took the integration
>> provided at Google.
>>
>>  
>>
>> Currently I am running into that problem that conversation.flash
>> behaves like request scope.
>>
>> I have a 4 step workflow and one controller bean for that workflow:
>>
>>  
>>
>> <bean id="regUserDirectPlanningController"
>> class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
>>
>>               scope="conversation.flash" depends-on="reservationJSF">
>>
>>             <property name="planningWorkflow"
>> ref="regUserDirectPlanning"/>
>>
>>             <property name="reservationData" ref="reservationFormBean"/>
>>
>>             <property name="chainData" ref="timeChainJSF"/>
>>
>>             <property name="reservationConfirmation"
>> ref="reservationJSF"/>
>>
>>             <property name="messageFormatter" ref="jsfMessageFormatter"/>
>>
>>             <property name="resourceManager" ref="resourceManager"/>
>>
>>             <!--
>>
>>             <property name="calendarJSF" ref="calendarJSF"/>
>>
>>              -->
>>
>>             <property name="reservationType"
>> ref="simpleOrChainSelectionJSF"/>
>>
>>             <property name="reservationFactory"
>> ref="reservationBeanFactory"/>
>>
>> </bean>
>>
>>  
>>
>> The other beans that are referenced are either Singletons as they are
>> Business Objects, or they are also conversation scoped as they are
>> JsfBeans.
>>
>>  
>>
>> My problem is, that for each step in my workflow a new empty
>> regUserDirectPlanningController is created and i lose the internal state.
>>
>> In debugger I can see that the AOP proxies around the conversation
>> scoped beans are properly created, so I think it`s kind of an
>> configuration problem.
>>
>>  
>>
>> Does this problem sound familiar to anyone?
>>
>>  
>>
>> If needed I can provide more detailed infos about configuration.
>>
>>     
> You could try enabling debug level for the logging category
>  
> "org.apache.myfaces.orchestra.conversation.jsf.OrchestraAccessScopePhaseList
> ener".
>
> This is the class that is responsible for discarding access-scope
> (formerly called "flash" scope) beans.
>
> By the way, the name "flash" is now deprecated; "access" is the
> preferred term. The old name should still work, but AFAIK all the
> examples have been updated to the new name. Where did you see the old one?
>
> Regards, Simon
>
>
>
>   


AW: Orchestra beginner question: conversation.flash behaves like request scope

Posted by Stephan Frai <fa...@online.de>.
Hello Simon,

thank you for answering.

I saw the old "flash" example here: 
http://myfaces-orchestra-goodies.googlecode.com/svn/trunk

After I turned on logging I got the following logger output:

18 Mrz 2008 11:09:03,156 DEBUG [n.jsf.AccessScopePhaseListener: 161]
Clearing access-scoped conversation regUserDirectPlanningController after
rendering view /pages/ruplanning/regUserDirectPlanning.xhtml
18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
conversation:regUserDirectPlanningController
18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
clearing accessed conversation reservationFormBean after rendering view
/pages/ruplanning/regUserDirectPlanning.xhtml
18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
Clearing access-scoped conversation reservationJSF after rendering view
/pages/ruplanning/regUserDirectPlanning.xhtml
18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
conversation:reservationJSF
18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
clearing accessed conversation simpleOrChainSelectionJSF after rendering
view /pages/ruplanning/regUserDirectPlanning.xhtml
18 Mrz 2008 11:09:03,171 DEBUG [n.jsf.AccessScopePhaseListener: 161]
Clearing access-scoped conversation timeChainJSF after rendering view
/pages/ruplanning/regUserDirectPlanning.xhtml
18 Mrz 2008 11:09:03,171 DEBUG [stra.conversation.Conversation: 288] destroy
conversation:timeChainJSF
18 Mrz 2008 11:09:03,171 DEBUG [OrchestraFacesContextFactory$1: 129] Running
release
18 Mrz 2008 11:09:03,171 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
request


18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
Clearing access-scoped conversation regUserDirectPlanningController after
rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
conversation:regUserDirectPlanningController
18 Mrz 2008 11:13:15,640 DEBUG [n.jsf.AccessScopePhaseListener: 161]
Clearing access-scoped conversation reservationFormBean after rendering view
/pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
18 Mrz 2008 11:13:15,640 DEBUG [stra.conversation.Conversation: 288] destroy
conversation:reservationFormBean
18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 152] Not
clearing accessed conversation reservationJSF after rendering view
/pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
18 Mrz 2008 11:13:15,656 DEBUG [n.jsf.AccessScopePhaseListener: 161]
Clearing access-scoped conversation simpleOrChainSelectionJSF after
rendering view /pages/ruplanning/regUserDirectPlanningConfirmation.xhtml
18 Mrz 2008 11:13:15,656 DEBUG [stra.conversation.Conversation: 288] destroy
conversation:simpleOrChainSelectionJSF
18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 129] Running
release
18 Mrz 2008 11:13:15,656 DEBUG [dapter.jsf.JsfFrameworkAdapter:  69] Ending
request
18 Mrz 2008 11:13:15,656 DEBUG [OrchestraFacesContextFactory$1: 138] Release
completed


As you can see, the converstion is destroyed after every rendered view of
the workflow.
Do I have to use the ViewController annotation?


Greetings,

Stephan


-----Ursprüngliche Nachricht-----
Von: simon.kitching@chello.at [mailto:simon.kitching@chello.at] 
Gesendet: Dienstag, 18. März 2008 10:34
An: MyFaces Discussion
Betreff: Re: Orchestra beginner question: conversation.flash behaves like
request scope

Stephan Frai schrieb:
>
> Hello,
>
>  
>
> I am new to orchestra and just integrated it into my application.
>
> Myfaces 1.2.2
>
> Hibernate 3.2.5
>
> Spring 2.0.4
>
>  
>
> I`m using plain Hibernate without JPA, so I took the integration
> provided at Google.
>
>  
>
> Currently I am running into that problem that conversation.flash
> behaves like request scope.
>
> I have a 4 step workflow and one controller bean for that workflow:
>
>  
>
> <bean id="regUserDirectPlanningController"
> class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
>
>               scope="conversation.flash" depends-on="reservationJSF">
>
>             <property name="planningWorkflow"
> ref="regUserDirectPlanning"/>
>
>             <property name="reservationData" ref="reservationFormBean"/>
>
>             <property name="chainData" ref="timeChainJSF"/>
>
>             <property name="reservationConfirmation"
> ref="reservationJSF"/>
>
>             <property name="messageFormatter" ref="jsfMessageFormatter"/>
>
>             <property name="resourceManager" ref="resourceManager"/>
>
>             <!--
>
>             <property name="calendarJSF" ref="calendarJSF"/>
>
>              -->
>
>             <property name="reservationType"
> ref="simpleOrChainSelectionJSF"/>
>
>             <property name="reservationFactory"
> ref="reservationBeanFactory"/>
>
> </bean>
>
>  
>
> The other beans that are referenced are either Singletons as they are
> Business Objects, or they are also conversation scoped as they are
> JsfBeans.
>
>  
>
> My problem is, that for each step in my workflow a new empty
> regUserDirectPlanningController is created and i lose the internal state.
>
> In debugger I can see that the AOP proxies around the conversation
> scoped beans are properly created, so I think it`s kind of an
> configuration problem.
>
>  
>
> Does this problem sound familiar to anyone?
>
>  
>
> If needed I can provide more detailed infos about configuration.
>
You could try enabling debug level for the logging category
 
"org.apache.myfaces.orchestra.conversation.jsf.OrchestraAccessScopePhaseList
ener".

This is the class that is responsible for discarding access-scope
(formerly called "flash" scope) beans.

By the way, the name "flash" is now deprecated; "access" is the
preferred term. The old name should still work, but AFAIK all the
examples have been updated to the new name. Where did you see the old one?

Regards, Simon



Re: Orchestra beginner question: conversation.flash behaves like request scope

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Stephan Frai schrieb:
>
> Hello,
>
>  
>
> I am new to orchestra and just integrated it into my application.
>
> Myfaces 1.2.2
>
> Hibernate 3.2.5
>
> Spring 2.0.4
>
>  
>
> I`m using plain Hibernate without JPA, so I took the integration
> provided at Google.
>
>  
>
> Currently I am running into that problem that conversation.flash
> behaves like request scope.
>
> I have a 4 step workflow and one controller bean for that workflow:
>
>  
>
> <bean id="regUserDirectPlanningController"
> class="com.playoli.ruplanning.jsf.RegUserDirectPlanningController"
>
>               scope="conversation.flash" depends-on="reservationJSF">
>
>             <property name="planningWorkflow"
> ref="regUserDirectPlanning"/>
>
>             <property name="reservationData" ref="reservationFormBean"/>
>
>             <property name="chainData" ref="timeChainJSF"/>
>
>             <property name="reservationConfirmation"
> ref="reservationJSF"/>
>
>             <property name="messageFormatter" ref="jsfMessageFormatter"/>
>
>             <property name="resourceManager" ref="resourceManager"/>
>
>             <!--
>
>             <property name="calendarJSF" ref="calendarJSF"/>
>
>              -->
>
>             <property name="reservationType"
> ref="simpleOrChainSelectionJSF"/>
>
>             <property name="reservationFactory"
> ref="reservationBeanFactory"/>
>
> </bean>
>
>  
>
> The other beans that are referenced are either Singletons as they are
> Business Objects, or they are also conversation scoped as they are
> JsfBeans.
>
>  
>
> My problem is, that for each step in my workflow a new empty
> regUserDirectPlanningController is created and i lose the internal state.
>
> In debugger I can see that the AOP proxies around the conversation
> scoped beans are properly created, so I think it`s kind of an
> configuration problem.
>
>  
>
> Does this problem sound familiar to anyone?
>
>  
>
> If needed I can provide more detailed infos about configuration.
>
You could try enabling debug level for the logging category
 
"org.apache.myfaces.orchestra.conversation.jsf.OrchestraAccessScopePhaseListener".

This is the class that is responsible for discarding access-scope
(formerly called "flash" scope) beans.

By the way, the name "flash" is now deprecated; "access" is the
preferred term. The old name should still work, but AFAIK all the
examples have been updated to the new name. Where did you see the old one?

Regards, Simon