uCosminexus Application Server, EJB Container Functionality Guide
This subsection describes the precautions to be taken when implementing an Entity Bean (CMP).
According to the EJB 1.1 specifications and EJB 2.0 specifications, accessing the resource manager with the setEntityContext method is not allowed.
In the cases other than when you use a compound primary key as the primary key, you cannot use a user-defined type CMP field.
When using a Collection-type CMR field, or an Iterator of the Collection-type CMR field, you can access the CMR field and Iterator within the scope of the transaction when the CMR field is acquired. In the callTeam method of the following coding example, you must execute the getPlayers method that is the getter method of the CMR field, and all the operations using the succeeding Iterator in the same transaction (between [a] and [b]).
public void callTeam() { ... //[a] Collection playersInTeam = team.getPlayers(); Iterator i = playersInTeam.iterator(); while (i.hasNext()) { LocalPlayer p = (LocalPlayer) i.next(); ... } //[b] }
If you execute this coding example outside the transaction, the IllegalStateException exception will occur. To avoid this, specify the settings in CMT to execute within the transaction.
The following limitations are applicable for using the cascade-delete of CMR:
When an interface and the abstract class are specified in the <prim-key-class> tag of the DD of a CMP Entity Bean, the error message KDJE42039-E is output during the deployment, and the deployment processing terminates with an error.
When you invoke an Entity Bean by using the home interface, you obtain the references by invoking the create method of the home interface; however, after completing the invocation of the Entity Bean, make sure that you release the references by invoking the remove method.
If you do not release the references, the memory on the J2EE server will be consumed.
You cannot specify an array as the argument type of the finder or select methods of EJB QL.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.