12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EJB Container-level Properties<br />

Table 31.1<br />

EJB container properties (continued)<br />

Property Description Default<br />

ejb.useDynamicStubs=true|false<br />

ejb.usePKHashCodeAndEquals=true|false<br />

This property is only relevant for CMP<br />

2.0 entity beans that provide local<br />

interfaces. If set, the Container, which<br />

otherwise uses CORBA to dispatch<br />

calls, uses a dynamic proxy-based<br />

scheme to dispatch calls (creating<br />

custom lightweight, non-CORBA<br />

references). These local dynamic stubs<br />

provide many optimizations, especially<br />

due to the callers and callees being in<br />

the same VM, making a direct dispatch<br />

to the beans without going through the<br />

CORBA layer. Also, since the dynamic<br />

stubs are aware of the EJB container<br />

data structures, they access the target<br />

beans more quickly. Note that currently<br />

the stub generator, java2iiop (called<br />

using the iastool or directly) still<br />

generates the stubs for all the interfaces<br />

in the archive. When ejb.useDynamicStubs<br />

is active, the subset of stubs that<br />

correspond to the selected CMP 2.0<br />

beans are ignored.<br />

This feature, when used, makes the<br />

whole dispatch mechanism dynamic,<br />

providing dynamic stubs for the client<br />

side as well as dynamic skeletons on<br />

the <strong>server</strong> side. Any statically generated<br />

stub and skeleton classes in the archive<br />

are ignored.<br />

You set the property in the bean.<br />

However, if there isn't an issue with<br />

using the property in all the entity<br />

beans, the easiest way is to set it at the<br />

EAR level in the deployment descriptor.<br />

Important:<br />

You must use this property in<br />

conjunction with<br />

ejb.usePKHashCodeAndEquals.<br />

Data structures that support Active<br />

Cache (TxReady cache) and<br />

Associated Cache (Ready beans<br />

cache) use java.util.Hashtable, and<br />

java.util.HashMap. The values (entity<br />

bean instances) pooled in these data<br />

structures are keyed on the primary key<br />

values of the cached entity beans. As<br />

we know, the implementation of<br />

Hashtable relies on computing<br />

hashCode() and calling equals()<br />

methods of the keys to place and locate<br />

the values. These data structures are in<br />

the critical code path and are accessed<br />

frequently by the container while<br />

dispatching calls to methods in entity<br />

beans The default in BES is a reflectionbased<br />

computation. When this property<br />

is set, the container uses a user<br />

supplied implementation of the equals()<br />

and hashCode() methods.<br />

true<br />

true<br />

332 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!