Short addendum: If I'm swearing and complaining about certain CDI features, then don't take this as a general nag against CDI. CDI is overall the best spec I've read in years. But as in every spec there are some features which looked great at the first glance but are of not much use in big real world projects.
LieGrue, strub ----- Original Message ----- > From: Mark Struberg <[email protected]> > To: "[email protected]" > <[email protected]> > Cc: > Sent: Wednesday, April 4, 2012 5:32 PM > Subject: Re: Custom Context utilities > > See CDI spec 6.7.4 > >> The container ensures that a long-running conversation may be associated > with at most one request > >> at a time, by blocking > or rejecting concurrent requests. If the container rejects a request, it must >> associate the request with a new transient conver- > sation and throw an exception of type >> javax.enterprise.context.BusyConversationException from the restore view > phase > >> of the JSF lifecycle. The application may handle this exception using the > JSF ExceptionHandler. > > I guess this was intended to hold Extended or Unmanaged EntityManagers (which > I > do NOT suggest to hold in a Conversation at all, but that's another story). > > LieGrue, > strub > > > ----- Original Message ----- >> From: Alan D. Cabrera <[email protected]> >> To: [email protected]; Mark Struberg > <[email protected]> >> Cc: >> Sent: Wednesday, April 4, 2012 2:15 PM >> Subject: Re: Custom Context utilities >> >> Is this a problem with the spec or its implementation? For example >> "@ConversationScoped beans are not allowed to be touched from > different >> requests". CDI is that specific? >> >> >> Regards, >> Alan >> >> >> >> On Apr 3, 2012, at 11:44 PM, Mark Struberg wrote: >> >>> Hi! >>> >>> Consider you have a registration form where name, login and password > are >> mandatory and all others are optional. >>> >>> If a user doesn't fill any of the mandatory fields, JSF will > return to >> the view without even invoking any of your actions. >>> >>> But if it doesn't call your action, then you also cannot make the >> @ConversationScoped backing bean longRunning... >>> Same is true if conversion errors exist, e.g. a user enters a wrong > date >> format. >>> >>> >>> This happens more often than you think. And in all those cases a CDI >> @ConversationScoped bean doesn't work. >>> Also there are problems with conversation propagation across GET > links. >> This basically doesn't work at all. >>> >>> The next issue is that @ConversationScoped beans are not allowed to be > >> touched from different requests. This is broken in >>> >>> a.) AJAX requests >>> b.) if you do a redirect. Because the 'new' (target where you >> redirected to) request might come back to your server even before the > original >> request is finished. >>> >>> >>> LieGrue, >>> strub >>> >>> >>> >>> >>> ----- Original Message ----- >>>> From: Alan D. Cabrera <[email protected]> >>>> To: [email protected] >>>> Cc: >>>> Sent: Wednesday, April 4, 2012 12:50 AM >>>> Subject: Re: Custom Context utilities >>>> >>>> I understand most of what the relevant slides discuss. >>>> >>>> What is does "failed conversion/validation" mean? Is > this >> the bit >>>> where all the type information is collected and validated? >>>> >>>> >>>> Regards, >>>> Alan >>>> >>>> >>>> >>>> On Apr 3, 2012, at 3:14 PM, Gerhard Petracek wrote: >>>> >>>>> hi alan, >>>>> >>>>> see e.g. [1] >>>>> >>>>> regards, >>>>> gerhard >>>>> >>>>> [1] http://s.apache.org/tj >>>>> >>>>> >>>>> >>>>> 2012/4/4 Alan D. Cabrera <[email protected]> >>>>> >>>>>> >>>>>> On Apr 3, 2012, at 6:17 AM, Mark Struberg wrote: >>>>>> >>>>>>> I'm not sure if the CDI Conversation scope is a > good >> example as >>>> it is >>>>>> widely considered pretty much broken ;) >>>>>> >>>>>> Can you provide background on your opinion for those of us > who >> have >>>> come >> >
