Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Want help for -instance-cache

 
Alka S.
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have included above code in the jsp but still updated data is not displaying in jsp.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic