Changing max-beans-in-cache
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
I 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
Similar Messages
-
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 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 -
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 -
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 -
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 -
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? -
Stateful beans in cache doesn't seem to work
I have a stateful bean that I have set max beans in cache to "1". When I deploy it, no errors reported or so, the Weblogic console still states "8" in the column "Cached Beans Current Count" when monitoring the bean.
When I view the descriptor in the console it looks fine. What can be wrong here?
Using Weblogic 8.1 SP4, here's the statueful descriptor:
<weblogic-enterprise-bean>
<ejb-name>MyStatefulBean</ejb-name>
<stateful-session-descriptor>
<stateful-session-cache>
<max-beans-in-cache>1</max-beans-in-cache>
</stateful-session-cache>
<allow-concurrent-calls>True</allow-concurrent-calls>
</stateful-session-descriptor>
<reference-descriptor>
</reference-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>test.mystatefulbean/MyStatefulBean/Home</jndi-name>
<local-jndi-name>test.mystatefulbean/MyStatefulBean/LocalHome</local-jndi-name>
</weblogic-enterprise-bean>I agree with you about the host not being able to install (or at least don't want to install/upgrade) their servers to php5.4... Unfortunately, I can't change that... but by shutting them off took care of all the quotes (single & double) and any other characters which would basically function like an addslashes() command. I'll paste the script below... It's still pretty much the same as when you helped me out with the script... Just minor adjustments::: If you can show me (even though I fixed the problem) how I would integrate the stripslashes() function to the comment field it would be helpful to know for future reference.
<?php // Script 1.0 - contactlist.php
if (isset($_POST['submit']) && !empty($_POST['submit'])) // Test if submit button named submit was clicked and not empty
if (!empty($_POST['first']) && !empty($_POST['last']) && !empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['comment'])) {
$comment=stripslashes($_POST[comment]);
$body = "First Name: {$_POST['first']}\nLast Name: {$_POST['last']}\nEmail Address: {$_POST['email']}\nContact Phone Number: {$_POST['phone']}\nContact Preference: {$_POST['contactvia']}\n\nBest Time To Contact: {$_POST['timepref']}\n\nComments:\n {$_POST['comment']}";
$body = wordwrap($body, 70);
mail([email protected]', 'NEW Customer Inquiry Submission',$body, "From: {$_POST['email']}");
header('Location: index.html'); //Redirect to new url if form submitted
?> -
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 -
Are EJB ( entity beans) are cached ?
Are EJB ( entity beans) are cached ?
I have a doubt here . As per my understanding , the entity beans are cached from the database. In that case , If I delete a row in the database by an external application ( say using TOAD tool) , how the Entity bean will be updated / reloaded ? Entity bean will be out of sync then .
Application server : weblogic/webspehere .>
You can use the refresh method of the EntityManager interface to read new values from the database (if you expect it to be out of sync), and use locks to prevent others from changing your data while the application is performing actions in a transaction.Did you mean I have to write code for this ? can't be made it automatic refresh by the container ? Is there any settings I can configure so that container can do it by itself proactively ?
Also, using locks ...is this a container settings or I need to configure myself in ejb-jar.xml ? Could you please shed some light here ? -
Change Max.no.quants in IMG but in database does not update.
hi,
I have an issue about reducing Max.no.quants in warehouse management. I defined putaway strategy P for Storage type definition. Then I changed Max.no.quants from 5 to 2 in Division of Storage Bins into Sections (IMG) and assigned Bin section A = 2 (Max.no.quants) in Bin Sectioning per Storage Bin Type and SUT (IMG). After that I removed items from stack 5 to 2 in each Storage bin. Then I checked storage bin in Bin sectioning tab I found that Max.no.quants still didn't change from 5 to 2 I thought it should be changed and no. of quants had changed to 2. So, that i checked table LAGP-KZVOL = " ". It seems the database was not up-to-date. When I create Transfer Order it had shown an error message below
Error due to inconsistent database (storage bin ZZ-01-01)
Are there any solutions to update Max.no.quants(LAGP-MAXQU) from 5 to 2 in Storage bin? or Can I create a program to update table LAGP-MAXQU and LAGP-KZVOL directly? (i am not sure which tables and fields should i have to concern?)hi,
I have an issue about reducing Max.no.quants in warehouse management. I defined putaway strategy P for Storage type definition. Then I changed Max.no.quants from 5 to 2 in Division of Storage Bins into Sections (IMG) and assigned Bin section A = 2 (Max.no.quants) in Bin Sectioning per Storage Bin Type and SUT (IMG). After that I removed items from stack 5 to 2 in each Storage bin. Then I checked storage bin in Bin sectioning tab I found that Max.no.quants still didn't change from 5 to 2 I thought it should be changed and no. of quants had changed to 2. So, that i checked table LAGP-KZVOL = " ". It seems the database was not up-to-date. When I create Transfer Order it had shown an error message below
Error due to inconsistent database (storage bin ZZ-01-01)
Are there any solutions to update Max.no.quants(LAGP-MAXQU) from 5 to 2 in Storage bin? or Can I create a program to update table LAGP-MAXQU and LAGP-KZVOL directly? (i am not sure which tables and fields should i have to concern?) -
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
Maybe you are looking for
-
White screen of death - iMac OSX Lion
I upgraded my 2007 iMac to Lion and after a few days of perfect running the think locked up. When I forced the power off and back on it seemed to be booting fine (chimes, apple logo, disk spinning up and I could hear the drive head seeking) but then
-
ICal, 10.5.6, MobileMe & the new Automatic Sync Features
when I read the release notes for 10.5.6 and saw that they had finally (/___sbsstatic___/migration-images/migration-img-not-avail.png) got ical to sync "instantly" from computer to computer in any direction, I knew it was time to download. Did the in
-
I updated to IOS 5 and apparently didn't get my apps backed up. So, they are now lost. Is there any way to restore them?
-
I purchesed one of these about amonth ago, to day when I plugged the machine into the mains an turned it on nothing happend. i have left it for about an hour and tried again, still nothing happens, what could be the problem and how would i go about f
-
"No Child Processes" - unable to install programs
Hi All For some funny reason, I can no longer install any new programs. No new updates installed, nothing really has changed. I tried to install Google Chrome and after loading the .dmg file all I got was a message "No child processes". So I assumed