This section describes the differences in EJB QL query support between EAServer 5.x and EAServer 6.0. See the Enterprise JavaBeans Specification, version 2.0 (or 2.1) for complete information about EJB-QL.
These situations do not directly effect EAServer migration, but you must keep these differences in mind when using the <ejb-ql> query tag in EAServer 6.0:
In EAServer 5.x, you could deploy an EJB JAR that had an ejb-ql query that used the abstract-schema-name to refer to various EJBs in the query. The case (uppercase or lowercase) of the abstract-schema-name in the ejb-ql query was not required to match the case of the EJB’s abstract-schema-name.
EAServer 6.0 is specification-compliant and requires the case in both names to match, otherwise deployment fails, and a NoClassDefFound Exception is generated. This example illustrates a case that is acceptable in EAServer 5.x, but fails in EAServer 6.0:
<ejb-name>ProcessType</ejb-name> <abstract-schema-name>ProcessType</abstract-schema-name> ... <query> <query-method> <method-name>findAll</method-name> <method-params /> </query-method> <ejb-ql>SELECT OBJECT(a) FROM Processtype AS a</ejb-ql> </query>
The query uses “Processtype” with a lowercase “t”, while the abstract-schema-name uses “ProcessType” with an uppercase “T”.
In EAServer 5.x, you could specify an empty <ejb-ql> element for a query in an EJB.
If you specify an empty <ejb-ql> element in EAServer 6.0, the deployment finishes successfully, but the SQL entry for the query in the EJB JAR configuration file is changed to “???”, signifying there is no SQL for the query. You must provide SQL for the query, and run recompile on the EJB. If not, an error similar to this is entered in the log file:
[loadComponents] 2006-06-02 07:56:08.126 WARN main [PersistenceManager:ejb.components.gwfserver.TaskType] SQL statement is missing for query method findAllChildTasks
A normal ejb-ql query in the ejbjar-config file looks like this:
<queryMethod method="findAll()" ejbql="SELECT OBJECT(a) FROM BusinessStatus AS a"/>
but if the <ejb-ql> element was empty in the deployment descriptor, you see:
<queryMethod method="findAllChildTasks(java.lang.Long p1, java.lang.String p2)" sql="???"/>
Here is an example of an empty <ejb-ql> element:
<query> <query-method> <method-name>findMandatoryChildTasks</method-name> <method-params> <method-param>java.lang.Long</method-param> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql /> </query>
In EAServer 5.x, you could specify the ejb-ql for a query that contained double quotes, but if you specify the ejb-ql with double quotes in EAServer 6.0, an error is generated because double quotes are not specification-compliant.
If you deploy an ejb-ql that contains double quotes in EAServer 6.0, the double quotes are automatically replaced with single quotes, and a warning message similar to this displays:
2006-06-02 07:52:14.040 WARN main [EjbCompiler] ejbql for findInactiveTasks in EJB TaskInstance contains double quotes which is not spec compliant, replacing double quotes with single quotes.
You can still use the double quotes, since the ejb-ql is turned into a SQL query that is appropriate for the database that is being used for the container managed persistence.