8.3.2 Available components
With Application Server, you can use the JPA with EJBs and Web applications. You can also use the JPA when user threads are used from Web applications. Note that you cannot use the JPA in the following environments or libraries:
-
EJB client application environment
-
J2EE application client environment
-
Container extension library
The following table lists the components that can use the JPA.
Components |
JPA usage |
|
---|---|---|
EJB |
Stateless Session Bean (EJB 3.0 and later)#1 |
Y |
Stateful Session Bean (EJB 3.0 and later)#1 |
Y |
|
Stateless Session Bean (earlier than EJB 3.0) |
N |
|
Stateful Session Bean (earlier than EJB 3.0) |
N |
|
Interceptor |
Y |
|
Message-driven Bean |
N |
|
Entity Bean |
N |
|
Web application |
Servlet, filter, event listener (Servlet 2.5 and later) |
Y |
JSP, JSP tag handler, JSP event listener, JSP tag library event listener #2 (Servlet 2.5 and later) |
Y |
|
Servlet, filter, event listener (earlier than Servlet 2.5) |
N |
|
JSP, JSP tag handler, JSP event listener, JSP tag library event listener (earlier than Servlet 2.5) |
N |
- Important note
-
If true is specified in the metadata-complete attribute of web.xml in Servlet 2.5 and later, the Web component annotations are not read. Therefore, you cannot use annotations to define the references for the persistence contexts or persistence units. However, you can define the references in web.xml.