Problem
- Product Name: Borland Application Server 6.7 & below
- Product Component: CMP 2.x
- Tested Product Version: 6.7
- Platform/OS version: All
In page 136 of the Borland Application Server 6.7 Developer Guide, it states the following definition for ejb.eagerLoad property.
eager-loads the entire row and keeps the data in the transactional cache. After loading, all database resources are released. Subsequent getters could get data in cache and not having to require any more database resources. CMP 2.x only.
Resolution
The ejb.eagerLoad property is applicable when it fulfills these 2 conditions.
1. In the ejb-borland.xml, it has specified CMP 2.x for the cmp-version element.
2. The finder methods for the same entity bean are called within the same transaction. It applies to all findByPrimaryKey, findAll or any other custom finders methods which are invoked 2 or more times within the same transaction.
The EJB container will load the entity bean for the primary key or a collection into a transaction cache. The only difference between ejb.eagerLoad=true & ejb.eagerLoad=false lies in whether the database resources are released. In the former, the JDBC ResultSet is closed as all the fields are loaded into the entity bean whereas it is not closed for the latter.
Currently, a defect CR 10117 is created where the EJB container does not cache the JDBC collection when ejb.eagerLoad is set to true. The EJB container will perform JDBC queries to load every entity bean within the collection. The workaround is either not to set ejb.eagerLoad property or set ejb.eagerLoad=false in the ejb-borland.xml.
#AppServer
#Security
#VisiBroker
#ejb-borland.xml
#CMP
#ejb.eagerLoad