javastateless-session-beanstateful-session-beansession-bean

What is the default type of a Session Bean?


I was reading best practices related to JavaEE APIs and came across a suggestion to use @Stateless and @Path together to make thread safe. That prompted me to inquire that when we do not mention anything, what is the type of session bean? Is it by default Stateful?


Solution

  • There is no default type of a session bean. A class only becomes a session bean by annotating it with @Stateless, @Stateful or @Singleton.