Skip Headers

# BEA WebLogic Server and the toplink-ejb-jar.xml File

Previous

Next

When deploying a CMP application to BEA WebLogic Server, the `toplink-ejb-jar.xml` file contains a reference to the `project.xml` file.

Example: BEA WebLogic Server toplink-ejb-jar.xml File shows a typical BEA WebLogic Server `toplink-ejb-jar.xml` file:

BEA WebLogic Server toplink-ejb-jar.xml File

    <?xml version="1.0"?>
    <!DOCTYPE toplink-ejb-jar PUBLIC "-//Oracle Corp.//DTD TopLink CMP WebLogic 10.0.3 Developer Preview//EN" "toplink-wls-ejb-jar_10_0_3.dtd">
    <toplink-ejb-jar>
        <session>
            <name>ejb20_EmployeeDemo</name>
            <project-xml>Employee.xml</project-xml>
            <login>
                <datasource>jdbc/JTSTopLinkDS</datasource>
                <non-jts-datasource>jdbc/TopLinkDS</non-jts-datasource>
            </login>
            <customization-class>
               oracle.toplink.demos.ejb.cmp.wls.employee.EmployeeCustomizer
            </customization-class>
        </session>
    </toplink-ejb-jar>

For BEA WegLogic Server, you can specify an optional deployment customization class (that implements `oracle.toplink.ejb.cmp.DeploymentCustomization` interface) used to allow deployment customization of TopLink mapping and run-time configuration. In Example: BEA WebLogic Server toplink-ejb-jar.xml File, the deployment customization class is named `EmployeeCustomizer`. This deployment customization class must be fully qualified by its package name and included in the deployment JAR.

At deployment time, the TopLink runtime creates a new instance of this class and invokes its methods `beforeLoginCustomization` (before the TopLink runtime logs in to the session) and `afterLoginCustomization` (after the TopLink runtime logs in to the session), passing in the TopLink session as a parameter.

Use your implementation of the `beforeLoginCustomization` method to configure session attributes not supported by the `pm-properties`, including the following:

- cache coordination

- parameterized SQL

- native SQL

- batch writing/batch size

- byte-array/string binding

- EIS login

- event listeners

- table qualifier

- sequencing

In Example: BEA WebLogic Server toplink-ejb-jar.xml File, notice the `<non-jts-datasource>` element. The usage of this element is not limited to BEA WebLogic Server `toplink-ejb-jar.xml` file. Any time you use cache coordination with Java Transaction API (JTA), you need to configure this element through TopLink Workbench (see "Configuring a Nontransactional Read Login"). This enables TopLink to do the out-of-context read operations and optimization of the sequencing assignments (see "Externally Managed Transactional Data Sources").

For more information about session configuration, see Configuring a Session.