this is not addressed by the spec
Sorry if I misunderstood anything, but as I understand it the current behavior is not compliant. (For a reason that I think is unrelated to CDI 125.) I think conversation.begin() must, per spec, have the effect of starting a new conversation. As far as I understand, it currently does nothing, in my example described here above. To put it otherwise, when opting for lazy init, I believe WELD should initialize the context when a Conversation object’s begin method is first called.
it's not useful to create an HTTP session just to store the conversation id
I guess it depends on what you mean by useful. At least, in my example, whether the HTTP session is created does make an externally visible difference (namely some servlet return an error vs no error). I agree that my example is somewhat academic, but at least from a learning point of view the current behavior is hard for newcomers to CDI to understand. (This example was developed for a course I teach about Java EE.)
|