两边都可以实现了,第二种方法是在weblogic-ejb-jar文件中写。

解决方案 »

  1.   

    你用JBuilder开发的时候,就可以在属性里边直接设置,这是我在JB里边设置后的XML文件内容
    weblogic-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
        <weblogic-enterprise-bean>
            <ejb-name>VisitBuy</ejb-name>
            <stateless-session-descriptor>
                <pool>
                    <max-beans-in-free-pool>1000</max-beans-in-free-pool>
                    <initial-beans-in-free-pool>1000</initial-beans-in-free-pool>
                </pool>
            </stateless-session-descriptor>
            <reference-descriptor>
                <resource-description>
                    <res-ref-name>jdbc/csmdb</res-ref-name>
                    <jndi-name>csmdb</jndi-name>
                </resource-description>
            </reference-descriptor>
            <enable-call-by-reference>True</enable-call-by-reference>
            <jndi-name>VisitBuy</jndi-name>
            <local-jndi-name>VisitBuyLocal</local-jndi-name>
        </weblogic-enterprise-bean></weblogic-ejb-jar>
    Entity Bean就写成如下的样子:
                <entity-cache>
                    <max-beans-in-cache>10000</max-beans-in-cache>
                    <idle-timeout-seconds>1800</idle-timeout-seconds>
                </entity-cache>