Less than 42 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stateful bean marked as @WebService ?  RSS feed

 
Ramy Nady
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I always use stateless session bean for my business logic and I can then expose it as web service , using @stateless and @WebService.

Is it available to do the same using statefuel session bean instead ?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to? A stateful bean is meant to contain conversational state. A stateless bean can also contain state, it just shouldn't be exposed. Something like an HttpClient should be no problem. And if you need state that can't be disposed of, use a singleton bean instead. Just make sure to correctly configure concurrency, otherwise it can be a huge bottleneck.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!