W R I T E   A N D   D E P L O Y   J 2 E E   A P P L I C A T I O N S  
of concurrent users they may have only a few SLSB available because the time elapsed of a 
call is short compared to the time waiting for the next call. 
The disadvantage of a SLSB is that the client has to maintain states and transactions 
between calls. So for local client like Web applications maintaining states can be difficult 
and for remote clients handle transactions over several calls can be costly. 
Speaking of transactions in a Bean Managed Transaction (BMT for short) SLSB any 
incoming transaction is suspended and a created transaction within the call must be 
committed or rolled back before the method returns. 
For a SLSB it is not uncomment to use one or more Entity Beans. During development the 
JNDI names of the EJBs maybe different to what they are in the production environment 
because a JNDI name is already used or there is a different naming convention. That is why 
the developer should use EJB references instead of the  public  JNDI name of the EJB. This 
allows the deployer to change the  public  JNDI name without breaking the application 
except for a remote client. The same applies also to resources like mail or datasources. In 
XDoclet another EJB is referenced by: 
* @ejb:ejb ref ejb name="test/TestEntity" 
 *              ref name="mytest/TestEntity" 
 * 
Later on it can be used this way: 
Context lContext = new InitialContext(); 
TestEntityHome lHome = (TestEntityHome) PortableRemoteObject.narrow( 
   lContext.lookup( 
      "java:comp/env/ejb/mytest/TestEntity" 
   ), 
   TestEntityHome.class 
); 
The EJB DD contains then: 
 
   ejb/mytest/TestEntity 
   Entity 
   test.interfaces.TestEntityHome 
   test.interfaces.TestEntity 
   test/TestEntity 
 
Now the deployer can adjust the JNDI names of the EJBs in the JBoss specific DD 
(jboss.xml) without changing anything else. The issue becomes a little bit trickier when an 
EJB is referenced in another application but the principle stays the same. 
48






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

best web hosting

 

Our partners: PHP: Hypertext Preprocessor Cheap Web Hosting JSP Web Hosting Ontario Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Java Hosting Cheapest Hosting

Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved