Max beans in pool
how to set sessions beans as max-benas-inpool
like weblogic-jar.xml. how should i do in oc4j. in whihc xml file
i need to configure.
thanx in advance.
suri
Hi Suri,
I don't know how to do it, but there may be something available in the
"orion-ejb-jar.xml" file.
Documentation for this file can be found from the following URLs:
http://www.atlassian.com
http://www.orionserver.com
Good Luck,
Avi.
Similar Messages
-
Setting max bean pool size in MDB
Hi,
I need to set the max bean pool size for my MDB to 1. This MDB is a part of my application and is packaged in an ear.
I tried to set it with the following annotation -
import javax.ejb.*;
@MessageDriven
(mappedName = "MyQueue",
name = "MyMDB",
activationConfig = {
@ActivationConfigProperty(propertyName="maxBeansInFreePool",
propertyValue="1"),
@ActivationConfigProperty(propertyName="initialBeansInFreePool",
propertyValue="1"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
However, this does not seem to work since I see the Current pool count on the WLS console as 3 after processing is done.
After looking at various posts in this forum, I also tried it with weblogic ejbgen as follows-
import weblogic.ejbgen.*;
@MessageDriven(ejbName = "MyMDB",
destinationType = "javax.jms.Queue",
initialBeansInFreePool = "1",
maxBeansInFreePool = "1",
destinationJndiName = "MyQueue")
However, with this the MDB did not get deployed in WLS.
I am using Weblogic 10.3 / EJB 3.0.
Any help on this is greatly appreciated.
Thanks
MeeraAs far as I know, it currently isn't possible to set max-beans-in-free-pool via annotations. You can use a deployment plan (configurable from console and/or follow the link supplied by atheek1).
I think you can also automatically generate descriptors based on javadoc text via ejb-gen, I'm not quite sure if this tooling can work in conjunction with EJB 3.0 annotations. See http://download.oracle.com/docs/cd/E12840_01/wls/docs103/ejb/EJBGen_reference.html
Tom -
Max-beans-in-cache, transactions and passivation
WLS 6.1 sp4
database concurrency, oracle
I compute max-beans-in-cache as:
(max # fetched in a transaction) * (number of worker threads)
therefore if I think that a table with have at most 500 rows and the
server is configured with 20 worker threads I have 500 * 20 = 10000 as
my max-beans-in-cache.
In my test the table has 7 rows. In our load test I see the Beans In
Use Count go up to 9999 instances and then start passivation.
I have two questions:
1) What does 'Beans In Use Count' really mean
2) why is weblogic using much more memory than it should to store 7 unique entities?
thanksSee my comments below.
S
Chad Urso McDaniel <[email protected]> wrote:
>
I understand this, but WebLogic should either reuse objects in the
cache/pool or not cache them at all. There are cases where the objects in the cahce are used. For e.g. with entity
beans and Read-Only concurrancy, when cache-between-tx is set. However I noticed
this behavior for other cases too and therefore the caching is not all that intellegent.
Also the beans in the pool are reused.
The current situation results in
objects being allocated, referenced by the cache so they will never be
garbage collected, but the objects are never used again once their
transaction completes. This is very, very wasteful with memory.
In some cases as mentioned above.
S
"Sri" <[email protected]> writes:
Hi,
The reason for having so many entries is due to fact that there isno way WLS
would know there are only 7 rows in the db everytime an entity beanis created/modified/accessed.
For e.g., if you run a test where you do 'findAll' the first run wouldhave 7
beans and the next most likely (There is another parameter that youcould use
to control number of beans in the cache, idle-timeout-seconds. Thoughits not
clear from the doc how the entity beans are handled wrt this parameter,it might
passivate entity beans if this timeout occurs) 14 and so on. If thisis a overhead
for your system then reduce this number.
S
container start removing beans before Chad Urso McDaniel <[email protected]>
wrote:
WLS 6.1 sp4
database concurrency, oracle
I compute max-beans-in-cache as:
(max # fetched in a transaction) * (number of worker threads)
therefore if I think that a table with have at most 500 rows and the
server is configured with 20 worker threads I have 500 * 20 = 10000as
my max-beans-in-cache.
In my test the table has 7 rows. In our load test I see the BeansIn
Use Count go up to 9999 instances and then start passivation.
I have two questions:
1) What does 'Beans In Use Count' really mean
2) why is weblogic using much more memory than it should to store7 unique
entities?
thanks -
Questions about entity bean caching/pooling
We have a large J2ee app running on weblogic6.1 sp4. We are using entity beans
with cmp/cmr. We have about 200 EntityBeans and accessed quite heavily. We are
struggling with what is the right setting of max-beans-in-cache and idle-time-out.
The current max heap setting is 2GB. With the current setting (default setting
of max-beans-in-cache to 1000, with a few exceptions to take care of cachefullexceptions)
we run into extended gc happening after about 4 hours. The memory freed gradually
reduces with time and lurks around the 30% mark after about 4 hours of run at
the expected load. In relation to this we had the following questions
1. What does caching mean?
a. If a bean with primary key 100 exists in the cache, and the following
is done what is expected
i. findByPrimaryKey(100)
ii. findBySomeOtherKey(xyz)
which results in loading up bean with primary key 100
iii. cmr access to bean with
primary key 100
Is the instance in the cache reused at all between transactions?
If there is minimal reuse of the beans in cache, Is it fair to assume that caching
can only help loading of beans within a transaction. If this is the case, is there
any driver to increase the max-beans-in-cache other than to avoid CacheFullException?
In other words, is it wrong to say that max-beans-in-cache should be set to the
minimum value so as to avoid CacheFullExceptions.
2. Again what is the driver of setting idle-time-out to a value? ( We currently
have it at 30 secs) Partly the answer to this question would again go back to
what amount of reuse is done from cache? Is it right to say that it should be
set to a very low value? (Why is the default 10 min?)
3. Can you provide us any documentation that explains how all this works
in more detail, particularly in relevance to entity beans. We have already read
the documentation from weblogic as is. Anything to give more explicit detail?
Any tools that can be of use.
4. What is the right parameter (from among the things that weblogic console
throws up) to look at for optimizing?
Thanks in advance for your help
Cheers
ArunThe behaviour changes according to these descriptor settings: concurrency-strategy,
db-is-shared and include-updates.
1. If concurrency-strategy is Database, then the database is used to provide locking
and db-is-shared is ignored. A bean's ejbLoad() is called once per transaction,
and the 'cache' is really a per-transaction pool. A findByPrimaryKey() always
initially hits the db, but can use the cache if called again in the same txn (although
you'd simply just pass a reference around). A findByAnythingElse() always hits
the db.
2. If concurrency-strategy is ReadOnly then the cache is longer-term: ejbLoad()
is only called when the bean is activated; thereafter, the number of times ejbLoad()
is called is influenced by the setting of read-timeout-seconds. A findByPrimaryKey()
can use the cache. A findByAnythingElse() can't.
3. If concurrency-strategy is Exclusive then db-is-shared influences how many
times ejbLoad() is called. If db-is-shared is false (i.e. the container has exclusive
use of the underlying table), then the ejbLoad() behaviour is more like ReadOnly
(2. above), and the cache is longer-term. If db-is-shared is true, then the ejbLoad()
behaviour is like Database (1. above).
Exclusive concurrency reduces ejbLoads(), increases the effectiveness of the cache,
but can reduce app concurrency as only one instance of an entity bean can exist
inside the server, and access to it is serialised at the txn level.
You can't use db-is-shared = false in a cluster. So Exclusive mode is less useful.
That's when you think long and hard about Tangosol Coherence (http://www.tangosol.com)
4. If include-updates is true, then the cache is flushed to the db before every
non-findByPrimaryKey() finder call so the finder (which always hits the db) will
get the latest bean values. This overrides a true setting of delay-updates-until-end-of-tx.
The max-beans-in-cache setting refers to the maximum number of active beans (really
beans that have been returned by a finder in a txn that hasn't committed). This
wasn't checked in SP2 (we have an app that accidently loads 30,000 beans in a
txn with a max-beans-in-cache of 3,000. Slow, but it works, showing 3,000 active
beans, and 27,000 passivated ones...).
This setting is checked in SP5, but I don't know about SP4. So you do need to
size appropriately.
In summary:
- The cache isn't nearly as useful as you'd like. You get far more db activity
with entity beans than you'd like (too many ejbLoads()). This is disappointing.
- findByPrimaryKey() finders can use the cache. How long the cache is kept around
depends on concurrency-strategy.
- findByAnythingElse() finders always hit the db.
WebLogic 8 tidies all this up a bit with a cache-between-transactions setting
and optimistic locking. But I believe findByAnythingElse() finders still have
to hit the db - ejbql is never run against the cache, but is always converted
to SQL and run against the db.
Hope this is of some help - feel free to email me at simon-dot-spruzen-at-rbos-dot-com
(you get the idea!)
simon. -
Max Beans in Cache causes NULL Pointer Exception
Hi All,
a rather weird event (from our perspective) occurs when we do the
following:
We have an entity bean set to max beans in cache 100 (default value of
our deployment tool ), the database table related to that bean holds
lets say 300 entries.
Doing a find all and in the same session bean instanciated transaction a
processing loop over the enumeration of beans we get an NULL Pointer
exception when accesing the 101 Bean. Neverthless the Weblogic server
increases the cache size automatically but obviously not fast enough and
not on time.
has anyone experienced the same problem and has a fix for it, appart
from increasing the cache size in the deployment descriptor ?
any help welcome
MichaelHi Michael.
Can you post the stack trace of the NullPointerException? Was it in
your code or ours? Also, what version of WebLogic are you using?
-- Rob
Rob Woollen
Software Engineer
BEA WebLogic
[email protected]
Michael Rupprecht wrote:
Hi All,
a rather weird event (from our perspective) occurs when we do the
following:
We have an entity bean set to max beans in cache 100 (default value of
our deployment tool ), the database table related to that bean holds
lets say 300 entries.
Doing a find all and in the same session bean instanciated transaction a
processing loop over the enumeration of beans we get an NULL Pointer
exception when accesing the 101 Bean. Neverthless the Weblogic server
increases the cache size automatically but obviously not fast enough and
not on time.
has anyone experienced the same problem and has a fix for it, appart
from increasing the cache size in the deployment descriptor ?
any help welcome
Michael -
Reporting on Max beans ever in cache
In the Weblogic 5.1 console, for Distributed Objects/EJB/Deployed Beans, on
the properties tab there are values for max beans ever in cache and max
cache size. Is there some way to access these values through a java class
(or some other way) so that I can do a report to see what EJBs have come
close to reaching their max cache size. We have over 500 beans deployed and
need some way to pro-actively check these values. I did not see any API doc
for the console on the website.
ThanksYou can start by looking at this example:
http://dima.dhs.org/misc/WLStats.jsp
and serverinfo utility at
http://developer.bea.com/code/alpha.jsp
Chip Whiteside <[email protected]> wrote:
In the Weblogic 5.1 console, for Distributed Objects/EJB/Deployed Beans, on
the properties tab there are values for max beans ever in cache and max
cache size. Is there some way to access these values through a java class
(or some other way) so that I can do a report to see what EJBs have come
close to reaching their max cache size. We have over 500 beans deployed and
need some way to pro-actively check these values. I did not see any API doc
for the console on the website.
Thanks--
Dimitri -
Hi ,
I have the following parameter set in weblogic-ejb-jar.xml for a statefulsession bean.
==================================================
stateful-session-cache>
<max-beans-in-cache>2</max-beans-in-cache>
<idle-timeout-seconds>600</idle-timeout-seconds>
</stateful-session-cache>
==================================================
I then create more than 2 requests(approx 10) to the stateful session bean for which the above parameter is set.
In EJB-MONITORING-Stateful Ejbs I have the following fields set from the customize view:
Activation Count
Passivation Count
Cache Access Count
Cache Miss Count
Cached Beans Current Count
EJB Name
My understanding is that no more than 2 beans should appear in the Cached Beans Current Count.If the request is sent from more than 2 browsers invoking the stateful bean I should get Invocation Target exception.
But upon sending requests from more than 2 browsers invoking the same session bean I see that :
count of Cached Beans Current Count = number of browsers/clients from where the request is coming.
There is no exception.
Kindly clarify my understanding.
ThanksHi,
if you give some number in <max-beans-in-cache>number</max-beans-in-cache>.Then Weblogic Server going to create that many number of objects initially .
In case of statefull SessionBeans, If you give 3 ,Then Server creates 3 objects for that bean to provide service to the 3 clients at a time .
Whenever it receives the 4 requests at a time then three request's will be served at a time and 4th request will wait until the server passivate any object out of 3 in some persistant storage and create the object for 4th client.
it will not throw any exception or error if we sent more than number of requests which we were mention in max-beans-in-cache.
----Anilkumar kari -
Max-beans-in-cache ==== Error
Hi all,
I have a entity bean with max-beans-in-cache=5000 and one of the findByXXX fetches
more than that and the application stops with an exception. Is there anyway or
a strategy to follow when cases like this where the records of find exceeds the
max limit. This is a huge data process application and we tried to do maximum
filters to reduce the records to minimal.
Please help me with your thoughts or ideas to .. how to avoid or is there any
deployment time argument .. etc
using WL 7.0
Thanks
-arunIf you just invoke the finder, then the container should not complain
about bringing back > max-beans-in-cache elements. However if you try
to enlist > max-beans-in-cache beans in a transaction, it will throw a
CacheFull.
One way to avoid this is to limit your maxRows returned by the finder.
This can be done in the CMP descriptor.
-- Rob
Arun nair wrote:
Hi all,
I have a entity bean with max-beans-in-cache=5000 and one of the findByXXX fetches
more than that and the application stops with an exception. Is there anyway or
a strategy to follow when cases like this where the records of find exceeds the
max limit. This is a huge data process application and we tried to do maximum
filters to reduce the records to minimal.
Please help me with your thoughts or ideas to .. how to avoid or is there any
deployment time argument .. etc
using WL 7.0
Thanks
-arun -
Max-beans-in-cache, cachefullException, outOfMemoryError
Hi,
I am trying to find the best way to find the numbers to be set in max-beans-in-cache
for entity beans. I have a stateless session bean through which I access the entity
beans. If I don't set any value for this property, in some query which will return
2500 records, I get a cachefullexception and if I increase it and set this property
to say 5000, I get an outofmemory error. I am not sure how to decide what value
should be used. Any help or suggestion would be greatly appreciated. We are using
WLS 7.0 on NT machines in a cluster.
I have already tried the maxPermSize option in the jvm. The max heap size is
set to 768m.
Thanks,
JaideepPlease reply only to the newsgroup.
If you are doing a find and then invoking on the bean, splitting the transaction into
multiple transactions that return smaller sets of beans is the only thing I can think of to
get around the problem.
If you are simply doing a find, but not invoking the beans, you could set finders-load-bean
to false in the EJB deployment descriptor to avoid loading the bean when the finder is
called. The bean will then be loaded and put into the cache only when it is invoked.
However, this setting affects all finders defined on the bean and if you have transactions
that do a find and invoke, performance could be lower if set to false.
Unless relationship-caching is turned on, related beans are not loaded when a finder is
invoked.
Arunabh
"Chadha, Jaideep" wrote:
Thanks Arunabh. I tried different values and came
up with the ones that suite our needs. Also the
cache size is restricted in a transaction, we can
split the transactions into multiple transactions
especially for read-only data. Do you think that
would be a good idea? I was also thinking if it
was possible to define the attribute for the
entity beans especially in case of relationships that
they get loaded in finders when I need them but for
some methods they don't get loaded in finders. And
when a getXXX is invoked that particular bean gets
loaded at that time.
It will be helpful, if you could let me know.
Thanks,
JaideepArunabh Hazarika wrote:
Increasing the max-beans-in-cache will always mean higher memory requirements. Afraid
there is no way around it except to increase the max heap size. You could try a new
feature in WLS 7.0 - application level caches. This is specified in the application
deployment descriptor rather than at the bean deployment descriptor. With this cache,
the cache size can be specified in terms of memory-size rather than an instance-count.
You can find out how to set this from:
http://e-docs.bea.com/wls/docs70/programming/app_xml.html (search for entity-cache)
This cache would be shared across all EJBs in the application. Also, note that this will
not prevent CacheFullExceptions from occuring, but would be more useful in avoiding
OutOfMemory errors. To avoid CacheFullExceptions without indefinitely increasing the
heap size, try to limit the number of beans loaded in a single transaction.
Hope this helps
Arunabh
Jaideep wrote:
Hi,
I am trying to find the best way to find the numbers to be set in max-beans-in-cache
for entity beans. I have a stateless session bean through which I access the entity
beans. If I don't set any value for this property, in some query which will return
2500 records, I get a cachefullexception and if I increase it and set this property
to say 5000, I get an outofmemory error. I am not sure how to decide what value
should be used. Any help or suggestion would be greatly appreciated. We are using
WLS 7.0 on NT machines in a cluster.
I have already tried the maxPermSize option in the jvm. The max heap size is
set to 768m.
Thanks,
Jaideep -
Hi all
If I change max-beans-in-cache property then do I need to redeploy (run ejbc on)
the stateful session beans or will the server pick it up when I just restart the
app server.
I am using Weblogic 6.1 SP2
Regards
Kamran YousafI believe I was wondering this once myself. An easy way to find out is to change
the value and then restart the server and check the EJB's configuration in your
weblogic console.
You will need to redeploy the beans though which should happen automatically if
the timestamp on your ear file or jar file changes.
"kamran" <[email protected]> wrote:
>
Hi all
If I change max-beans-in-cache property then do I need to redeploy (run
ejbc on)
the stateful session beans or will the server pick it up when I just
restart the
app server.
I am using Weblogic 6.1 SP2
Regards
Kamran Yousaf -
Max-beans-in-cache, cachefullexception, outofmemory error
Hi,
I am trying to find the best way to find the numbers to be set in max-beans-in-cache
for entity beans. I have a stateless session bean through which I access the
entity beans. If I don't set any value for this property, in some query which
will return 2500 records, I get a cachefullexception and if I increase it and
set this property to say 5000, I get an outofmemory error.
I am not sure how to decide what value should be used.
Any help or suggestion would be greatly appreciated.
We are using WLS 7.0 on NT machines in a cluster.
Thanks,
JaideepIf you need to perform some sort of bulk processing then perhaps you
shouldn't be using
entity beans at all.
"Jaideep" <[email protected]> wrote in message
news:[email protected]..
>
unfortunately, for a specific functionality in our application we need toget that
many records. Now I am debating about changing the finder method so thatit returns
only 500 records at one time and then I can call it multiple number oftimes.
This may not be the best thing to do and we may take some kind of aperformance
hit also but it may avoid the cachefull and outofmemory problems.
Any suggestions or comments??
Thanks,
Jaideep
Rob Woollen <[email protected]> wrote:
First off, does what does the session bean or its caller do with the
2500 or 5000 records? i.e. do you really need to select that many.
Unfortunately there is no easy answer on how to set max-beans-in-cache.
It depends a lot on your memory, application, and load.
-- Rob
Jaideep wrote:
Hi,
I am trying to find the best way to find the numbers to be set in
max-beans-in-cache
for entity beans. I have a stateless session bean through which Iaccess the
entity beans. If I don't set any value for this property, in somequery which
will return 2500 records, I get a cachefullexception and if I increaseit and
set this property to say 5000, I get an outofmemory error.
I am not sure how to decide what value should be used.
Any help or suggestion would be greatly appreciated.
We are using WLS 7.0 on NT machines in a cluster.
Thanks,
Jaideep
Dimitri -
Max-beans-in-cache and getting mail
Hi,
Here is the situation. I am currently using the
max-beans-in-cache option in the stateful-session-cache . What I want to do is when the max bean amount has been reached and the bean is removed. At this point I would like to have an email or some kind of notification that this happened.
Does anybody have any idea how to do this?
thanks,
MarcHi,
Here is the situation. I am currently using the
max-beans-in-cache option in the stateful-session-cache . What I want to do is when the max bean amount has been reached and the bean is removed. At this point I would like to have an email or some kind of notification that this happened.
Does anybody have any idea how to do this?
thanks,
Marc -
Dynmically setting max bean count?
Hi,
With the applications we deploy we want to insure that the bean
pool and thread pool are inited at their maximum value. The only
thing is that depending on what machine we deploy the maximum
would not be the same, due to memory or processor constraints.
Currently we have to define these values manually. Is there any
way for us to write a plug-in to automatically set these values
based on an algorithm?
regards
AndreHello,
I think you can write a script that uses weblogic.Admin utility to automate this process after deploying your beans.
I can't remember if you can control the specific ejb properties you require, have a look at:
http://edocs.bea.com/wls/docs81/admin_ref/cli.html -
How to determine the value of max-beans-in-cache
As we have CacheFullException problem, but I dont know what is the side effect
if I set an extremely large value for this parament. Is there any proper way
to determine the proper value?
"Jenny Wong" <[email protected]> wrote:
>
>As we have CacheFullException problem, but I dont know what is the side
>effect
>if I set an extremely large value for this parament. Is there any proper
>way
>to determine the proper value?
Hi Jenny,
The WebLogic Server allows you to configure the number of active beans (with an
identity) which are present in the EJB cache.
This cache is the in-memory space where beans exist.
When a bean is brought into the cache, ejbActivate() is called, when it is removed,
ejbPassivate() is called. It is basically
equivalent to virtual memory being kept in memory or on disk. Tuning it too high
will use up memory unnecessarily.
Activation and passivation of EJBs is analogous to virtual memory on a computer.
You want to minimize the number of times that
your beans are activated and passivated. The cache size can help minimize this
activity. To set determine if you cache size
should be bigger, take a number of execution snapshots. Look at these snapshots
of your execution and see if there is a lot of
passivation and activation going on. If so, increase the size of your cache and
see if performance improves. Otherwise, leave this
value alone.
regards,
Ashok.
-
Min size for max-beans-in-cache / stateful EJB
Hello,
Weblogic (7 and 8) seems to have a minimum size for this setting.
This minimum seems to be around 8 instances because when we set it to 3 for
instance, the cache size reported by the admin console is 8 (with 8 active
clients) and no ejb has been passivated.
Is there an explanation for this behaviour ?
LaurentI would also like to know the answer to this one.
Can the default be changed via the administration console or config.xml? If so, where?
Maybe you are looking for
-
Table control View in Maintenance order Services tab
Hi Experts, I am trying to change the table control fields of the services tab of the maintenance order , when we use PM03 control key to generate services PR. I try to remove some check box which are earlier defined as invisible to make it visible.
-
HT3500 how do i make my printer connect to a new SSID
I have a new wireless address, and my printer's setting is the old wireless SSID. so my printer is not connected.... how do i make the printer to connect my new SSID??
-
GL Custom Reports not displaying source and line item Data after Upgrade
Hi, I am having this issue even though General Ledger Journal Entry Summarization is set to "No Summarization" and in SLA the Line Type is set in detail for Transfer to GL. Have you come accross a specfic example like this? Can you please guide me to
-
i lost my iphone , but i'm keeping track of it on find my iphone. lately i purchesed a new device and connected it to the same Apple ID i was using on my lost phone. i don't want the theif to access my account nor be able to purchase or update throug
-
Can someone explain the attached Finder screenshot
Hi, I have a Macbook Pro, just for home use. I noticed this 'Shared' access in Finder recently. It could have appeared after linking a new GPS device I got via a USB cable although it still appears without this being connected and after re-booting. I