Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Matthias is spot on.</p> <p>A @Stateless annotated bean is an EJB which by default provides <a href="http://docs.oracle.com/javaee/6/tutorial/doc/bncij.html" rel="noreferrer">Container-Managed-Transactions</a>. CMT will by default create a new transaction if the client of the EJB did not provide one.</p> <blockquote> <p><strong>Required Attribute</strong> If the client is running within a transaction and invokes the enterprise bean’s method, the method executes within the client’s transaction. If the client is not associated with a transaction, the container starts a new transaction before running the method.</p> <p>The Required attribute is the implicit transaction attribute for all enterprise bean methods running with container-managed transaction demarcation. You typically do not set the Required attribute unless you need to override another transaction attribute. Because transaction attributes are declarative, you can easily change them later.</p> </blockquote> <p>In the recent java-ee-7 <a href="http://www.oracle.com/technetwork/articles/java/jaxrs20-1929352.html" rel="noreferrer">tuturial</a> on jax-rs, Oracle has example of using EJBs (@Stateless).</p> <blockquote> <p>... the combination of EJB's @javax.ejb.Asynchronous annotation and the @Suspended AsyncResponse enables asynchronous execution of business logic with eventual notification of the interested client. Any JAX-RS root resource can be annotated with @Stateless or @Singleton annotations and can, in effect, function as an EJB ..</p> </blockquote> <p>Main difference between @RequestScoped vs @Stateless in this scenario will be that the container can pool the EJBs and avoid some expensive construct/destroy operations that might be needed for beans that would otherwise be constructed on every request.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload