EJBServer
Resin 2.1

Reference Guide
EJB Reference Guide

EJBServer
JNDI
Entity Config
Relation Config
Session Config
Resin-EJB Config
SQL mapping
Transaction Config
Message Config
EJB-QL
xdoclet
Config Summary
Burlap
JMS
CORBA/IIOP
Index
EJB Reference Guide
EJB Reference Guide
JNDI

The Resin-CMP EJB Server is implemented as a JNDI resource. Like any other resource, it is to be set up in resin.conf or web.xml.

The EJBServer resource

The following stripped-down web.xml sets up Resin-CMP so local clients can use java:comp/env/cmp to find the home interfaces.

Because the EJB server is a JNDI resource, it can be placed in any JNDI resource context: <web-app>, <host>, or <http-server>. An EJBServer in the <host> context, for example, will be shared across all applications for that host.

The following is a sample web.xml configuration. More details are available in:

EJBServer will automatically read the *.ejb files in WEB-INF and load their defined beans.

web.xml
<web-app>
  <!-- Database configuration -->
  <resource-ref>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.XADataSource</res-type>
    <init-param driver-name="com.caucho.jdbc.mysql.Driver"/>
    <init-param url="jdbc:mysql-caucho://localhost:3306/test"/>
  </resource-ref>

  <!-- Resin-CMP server configuration -->
  <resource-ref>
    <res-ref-name id="java:comp/env/cmp"/>
    <class-name id='com.caucho.ejb.EJBServer'/>
    <init-param data-source='java:comp/env/jdbc/test'/>
  </resource-ref>
</web-app>

EJBServer init-parameters
ParameterMeaningDefault
auto-compileIf true, automatically generate the persistence and EJB codetrue
create-database-schemaIf the entity beans do not yet exist in the data-source, create the tablesfalse
data-sourceThe database's JNDI namejava:comp/env/jdbc/test
distributedSet true for multiple parallel serversfalse
ejb-config-dirDirectory to search for *.ejb filesWEB-INF
entity-cache-sizeHow many entity beans are cached8192
entity-cache-timeoutHow long a loaded CMP bean can be cached before reloadingInfinity
resin-isolationWhether updates should use row-locking (FOR UPDATE) or rely on the database's isolation databasedatabase
jdbc-isolationSelects the JDBC isolation for an update transactionthe database's default
transaction-timeoutHow long a transaction should wait before timing out (in seconds)60
queue-connection-factorySets the JNDI name for the QueueConnectionFactorynone
topic-connection-factorySets the JNDI name for the TopicConnectionFactorynone
validate-database-schemaIf true, automatically validate against the database using JDBCfalse

Protocol Servlets

External protocols are generally implemented as servlets. Only applications which expose an external interface will have protocol servlets.

Burlap

<!-- Burlap protocol configuration -->
<servlet-mapping>
  <url-pattern id='/burlap/*'/>
  <servlet-name id='com.caucho.burlap.EJBServlet'/>
</servlet-mapping>


EJB Reference Guide
EJB Reference Guide
JNDI
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.