日期:2014-05-18  浏览次数:20779 次

hibernate 缓存问题 IE缓存问题 还是其他?
项目中利用hibernate来控制数据层,使用二级缓存配置文件如下:
Java code

<bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource" />
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.MySQLDialect
                </prop>
                <prop key="hibernate.cache.use_query_cache">true</prop>
                <prop key="hibernate.cache.provider_class">
                    org.hibernate.cache.EhCacheProvider
                </prop>
            </props>
        </property>
        <property name="mappingResources">
            <list>
                <value>cn/qdrk/strive/model/JzGtype.hbm.xml</value>


vo类如下:
Java code

<hibernate-mapping>
    <class name="cn.qdrk.strive.model.JzGtype" table="jz_gtype">
       <cache usage="read-write"/>
        <id name="gtId" type="java.lang.Integer">
            <column name="gt_id" />
            <generator class="native"></generator>
        </id>
        <property name="gtName" type="java.lang.String">
            <column name="gt_name" length="100" not-null="true" />
        </property>
        <property name="gtMark" type="java.lang.String">
            <column name="gt_mark" length="200" />
        </property>
       </class>
</hibernate-mapping>


种类的编辑页面如下:
HTML code
 
<html>
<head> 
<title>修改客户种类信息 </title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> 
<link href="css/home.css" rel="stylesheet" type="text/css">
</head>
<html:javascript formName="guesttypeForm" />
<body>
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
<html:form  method="post" action="/guesttype.do?method=addGuestype&bsid=${bsid}&gtid=${gtid}">
<input type="hidden" name="cp" value="${currentPage}" />
<table width="506" height="160"  border="0" cellpadding="0" cellspacing="0" style="border: 2px #6999CA solid;" class="style14">
  <tr> <td colspan="2"  height="34" align="center" class="style_title">客户种类修改 </td> </tr>
  <tr> <td  height="25"> </td> <td align="left">
业务:&nbsp; <html:text property="bsname" size="20"  readonly="true"> </html:text>&nbsp;&nbsp;&nbsp;&nbsp;