The following items are checked when an application using the JPA is deployed on the J2EE server:
The following is a description of the checks:
The following points describe the contents checked in the persistence unit definition:
Validates whether persistence.xml included in the application is in accordance with the persistence_1_0.xsd schema. If an error is found during the validation, the error message KDJE56526-E is output and the deployment is cancelled.
Checks whether the persistence unit name is null. If the persistence unit name is null, the error message KDJE56505-E is output and the deployment is cancelled.
Also, checks whether persistence units with duplicated names are defined in the application EAR files or in one EJB-JAR or WAR. If persistence units with duplicated names are defined, a warning message KDJE56500-W is output and the deployment continues. Note that in this case, only one persistence unit is actually deployed.
The contents checked differ depending on the transaction type of the persistence unit.
Table 5-10 Checked contents and operations to be performed when an error occurs during the check (for the JTA transaction type)
Checked contents | Operations when an error occurs during the check |
---|---|
The JTA data source (the data source specified in the <jta-data-source> tag of persistence.xml or the default value specified in the system properties) used in the persistence unit is specified. | The error message KDJE56527-E is output and the deployment is cancelled. |
The resource adapter that provides the JTA data source exists. | The error message KDJE56529-E is output and the deployment is cancelled. |
The resource adapter that provides the JTA data source is running. | |
The transaction support level of the resource adapter is LocalTransaction or XATransaction. | The error message KDJE56531-E is output and the deployment is cancelled. |
The connection factory interface of the resource adapter is javax.sql.DataSource. | The error message KDJE56533-E is output and the deployment is cancelled. |
Table 5-11 Checked contents and operations to be performed when an error occurs during the check (for the RESOURCE_LOCAL transaction type)
Checked contents | Operations when an error occurs during the check |
---|---|
The non-JTA data source (the data source specified in the <non-jta-data-source> tag of persistence.xml or the default value specified in the system properties) used in the persistence unit is specified. | The error message KDJE56528-E is output and the deployment is cancelled. |
The resource adapter that provides the non-JTA data source exists. | The error message KDJE56530-E is output and the deployment is cancelled. |
The resource adapter that provides the non-JTA data source is running. | |
The transaction support level of the resource adapter is NoTransaction. | The error message KDJE56532-E is output and the deployment is cancelled. |
The connection factory interface of the resource adapter is javax.sql.DataSource. | The error message KDJE56533-E is output and the deployment is cancelled. |
Checks whether the JPA provider class (class specified in the <provider> tag of persistence.xml) used by the persistence unit can be loaded from the application. If the loading of the class fails, the error message KDJE56503-E is output and the deployment is cancelled.
Checks whether the JAR file (JAR file specified in the <jar-file> tag of persistence.xml) referenced by the persistence unit exists. If the JAR file does not exist, the error message KDJE56506-E is output and the deployment is cancelled.
The JPA provider generates the persistence unit from the contents of persistence.xml parsed by the JPA container. If the persistence unit definition has a problem and if the JPA provider returns an error, the error message (KDJE56539-E) is displayed and the deployment is cancelled.
The following points describe the contents checked in the EntityManager and EntityManagerFactory references:
In the EntityManager and EntityManagerFactory references defined in the EJB and Web components, check whether the specified persistence unit name is an actually referable persistence unit name. Also, if the persistence unit name is omitted, check whether the persistence unit to be used can be identified. If an error is found in this check, the error message KDJE56501-E is output and the deployment is cancelled.
Check whether the transaction type of the persistence unit is the JTA when the container-managed EntityManager is used. If an error occurs in this check, the error message KDJE56534-E is output and the deployment is cancelled.
When EXTENDED is specified as the persistence context type with the EntityManager references, check whether the location where the references are defined is the Stateful Session Bean. If the references are defined in a location other than the Stateful Session Beans, the error message KDJE56535-E is output and the deployment is cancelled.