This week's book giveaway is in the Spring forum.
We're giving away four copies of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 and have Marten Deinum & Iuliana Cosmina on-line!
See this thread for details.
Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

EJB 3.1 Stateful and CDI Scope Conversation

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Greenhorn
Posts: 24
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic