Forums Register Login

EJB 3.1 Stateful and CDI Scope Conversation

+Pie Number of slices to send: Send
I have a question, if I have an ejb .. @Stateful and @ConversationScope, the client (jsf) makes a request to my ejb, the ejb starts a conversation.begin() .... do something and show the response to the client ... the client makes a another request where now do something and close the conversation (conversation.end()) .... the ejb @Stateful is removed too? Or i have to explicit call @Remove ?
+Pie Number of slices to send: Send
Hello,
If you want to remove the Stateful You have to call a Method annotated with @Remove.
But You can also annotate the Statefule with the @StatefulTimeout this means that after the unit value that You speified the container should remove the bean if the bean is idle.
Pay attention that the @PreDestroy Method is not called in this case (@StatefulTimeout).

Hope this help
+Pie Number of slices to send: Send
 

massimiliano cattaneo wrote:Hello,
Pay attention that the @PreDestroy Method is not called in this case (@StatefulTimeout).



In fact it's true only if the bean is in the Passivated state. If time out occurs in Method-Ready state, then the @PreDestroy method will be invoked.
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1975 times.
Similar Threads
Asynchronous notification of a stateful session bean
Session Bean Pooling
help required
Stopping thread in stateful session bean
Session EJB Quick question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:33:14.