You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Dain Sundstrom <da...@iq80.com> on 2008/04/04 03:33:53 UTC

Re: EJB Container Settings

For JPA beans (3.0 entities) the cache/pool settings are controlled by  
the JPA implementation.  If you haven't explicitly set a JPA provider,  
you will get OpenJPA.

FWIU, OpenJPA doesn't use an object pool since JPA objects are cheaper  
to create on the fly then it costs to pool instances (I don't think  
any of the JPA providers use object pools).  As for cacheing, the  
default OpenJPA caches uses a clever combination of weak and soft  
references so the cache is largely managed by the vm.

JPA is a really different beast than BMP or CMP and the configuration  
and tuning are quite different.  I suggest you profile you application  
to see if it is running within in your acceptable performance range  
(you should decide on the acceptable range before profiling to avoid  
adding unnecessary complexity to your application).  If it isn't, I'd  
start by reading the OpenJPA (assuming that is your provider) user  
manual, specifically the caching chapter (http://openjpa.apache.org/docs/latest/manual/ref_guide_caching.html 
).  You can always ask for help with tuning here, but for OpenJPA  
specific questions you may be better served on the OpenJPA users  
mailing list.

-dain

On Mar 31, 2008, at 11:30 AM, the666pack wrote:
>
> ok thank you,
>
> i hope that someone can bring some light in this question.. it would  
> be
> important for me to know how to "tune" the ejb3.0 container and thus  
> speed
> up the ejb handling. especially i am interested in
>
> - pool size for persistent entities (ejb 3.0)
>
> and IF it is possible to tune this at all.
>
> i thank you for your help,
>
> mario
>
>
> manucet wrote:
>>
>> Umm those apply to only CMP and BMP. Regarding entities I am not  
>> sure.
>> Probably Dain or David Blevins can throw more light here.
>>
>> Regards
>> Manu
>>
>>
>> On Sun, Mar 30, 2008 at 11:49 PM, the666pack <ma...@gmail.com>
>> wrote:
>>>
>>> thanks for your reply,
>>>
>>> so i am using EJB 3.0 with standard annotations, are these now CMP  
>>> or
>>> BMP? i
>>> thought this diversification does just apply to EJB 2.1..
>>>
>>> more: so this means that if EJB 3.0 are Container Managed Beans, i
>>> cannot
>>> set the pool size of the entity pool manually? because in the link  
>>> there
>>> is
>>> just mentioned one property " CmpEngineFactory".
>>>
>>> or am i wrong?
>>>
>>> greetings,
>>>
>>> mario.
>>>
>>>
>>>
>>>
>>> manucet wrote:
>>>>
>>>> Hi Mario,
>>>>          Feel free to ask as much questions as you want thats what
>>>> this list is for :).
>>>> The properties need to be set in the corresponding EjbContainer
>>>> GBeans. The properties that are exposed by OpenEJB are actually  
>>>> given
>>>> in the link below
>>>> http://openejb.apache.org/example-generated-documentation.html.
>>>> You need to set the properties in the corresponding Container  
>>>> GBeans
>>>> or as system properties.
>>>>
>>>> 1) Setting system property
>>>> If you set it as a system property then you will need to use the
>>> format
>>>> <container_name>.<property_name>.
>>>> An example of setting the system property is given in one of my
>>>> previous mails to you
>>>> http://www.mail-archive.com/user@geronimo.apache.org/msg09381.html
>>>>
>>>> 2) Setting on the container Gbeans
>>>> If you are setting the individual gbeans with the properties you  
>>>> can
>>>> give just the property name followed by the value in the  
>>>> config.xml.
>>>> eg:
>>>> <module name="org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/ 
>>>> car">
>>>>        <gbean name="EJBNetworkService">
>>>>            <attribute name="port">${OpenEJBPort +
>>> PortOffset}</attribute>
>>>>            <attribute name="host">${ServerHostname}</attribute>
>>>>        </gbean>
>>>>        <gbean name="DefaultStatelessContainer">
>>>>            <attribute name="properties">TimeOut=10
>>>>                     StrictPooling=false
>>>>                     PoolSize=15</attribute>
>>>>        </gbean>
>>>>    </module>
>>>> This is how we can set some properties for the stateless container.
>>>>
>>>> The GBean names are  
>>>> DefaultStatelessContainer,DefaultStatefulContainer
>>>> ,DefaultBMPContainer and DefaultCMPContainer. There is no Gbean
>>>> corresponding to the MdbContainer but you can set values on the
>>>> MdbContainer using the system property method
>>>>
>>>> Regards
>>>> Manu
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sun, Mar 30, 2008 at 1:41 PM, the666pack  
>>>> <ma...@gmail.com>
>>>> wrote:
>>>>>
>>>>> hello,
>>>>>
>>>>> sorry that i bring this topic on again, but it would be important
>>> for me
>>>>> to
>>>>> find out how or where to change the EJB-container settings in
>>> geronimo.
>>>>> as
>>>>> the ejb-container in geronimo is OpenEJB i hope that here is  
>>>>> someone
>>> who
>>>>> can
>>>>> tell me this. Most important would be where to set
>>>>>
>>>>> -Entity Bean Pool Size (max-pool-size)
>>>>> -Strict-Pool-Size (if available)
>>>>> -Commit Option
>>>>>
>>>>> i was searching but i did not find a possibility to change these
>>> options
>>>>> in
>>>>> geronimo OpenEJB entity container. i hope that someone can help me
>>> out
>>>>> with
>>>>> this and thank you for your help.
>>>>>
>>>>> greetings,
>>>>>
>>>>> mario
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/EJB-Container-Settings-tp16379417p16379417.html
>>>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/EJB-Container-Settings- 
>>> tp16379417p16385216.html
>>>
>>>
>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/EJB-Container-Settings-tp16379417p16398277.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>