Two Laptop Bag*
The moose likes EJB and other Java EE Technologies and the fly likes Want help for  -instance-cache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Want help for  -instance-cache" Watch "Want help for  -instance-cache" New topic
Author

Want help for -instance-cache

Alka S.
Greenhorn

Joined: Nov 29, 2003
Posts: 26
Hi,
I am using jboss as application server and ejb 2.0. We are facing some problem of instance caching. Our system has requirement to update database using external data entry application. After updating data from data entry application we are not able to see the updated data in the web application.
I think I need to tune properly cache time of instance pooling.
Can anybody please help in setting proper parameters using xdoclet for instance-cache-timeout/pool-cache-timeout
Thanks.
Augg Stine
Greenhorn

Joined: Mar 24, 2004
Posts: 27
hi
What is the TX attribute, u have given for ur sesion & entity bean.
I believe that the Business method in session bean is calling the entity bean and both come under a single TX.
And also, Plz check whether UR DB table has got updated and only ur jsp is not refreshed???

regards,
Augg
Alka S.
Greenhorn

Joined: Nov 29, 2003
Posts: 26
Yes. session bean is calling the entity bean.
When I am updating data from backend directly then jsp is not showing changed data even after refresh. But if same data is update from application (jsp) then DB table get updated and the jsp is also showing changed data.
I am trying to tuning parameters as follows in jboss.xml.
<container-configurations>
<container-configuration>
<container-name>LRU Configuration</container-name>
...
<instance-cache>org.jboss.ejb.plugins.EntitySessionInstanceCache</instance-cache>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>

<cache-policy-conf>
<min-capacity>5</min-capacity>
<max-capacity>200</max-capacity>
<overager-period>10</overager-period>
<max-bean-age>1</max-bean-age>
<resizer-period>10</resizer-period>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>
</container-cache-conf>
<commit-option>D</commit-option>
<optiond-refresh-rate>10</optiond-refresh-rate>
</container-configuration>
</container-configurations>
Augg Stine
Greenhorn

Joined: Mar 24, 2004
Posts: 27
hi,
I don't think that it is cache problem.
I think that it is a problem with our JSP.
Can u include the following code in ur jsp at the very begining and try ...
<%
//Remove the Cache from Browser.
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy
%>
Alka S.
Greenhorn

Joined: Nov 29, 2003
Posts: 26
I have included above code in the jsp but still updated data is not displaying in jsp.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Want help for -instance-cache
 
Similar Threads
ConnectionTimeOut Vs sessionTimeout problem
Synchronizing two hibernate sessions
jQuery , session timeout and cache issues
Delete cached data and load from database
WAS7 Dynacache configuration