关于hibernate隔夜问题

最近用hibernate作持久层(mysql),做了一个小网站,用tomcat+apache融合起来运行(redhat9.0)。
出现了三个问题,想请教各位高手如何解决?
1)[color=red]hibernate隔夜问题[/color]:发现当天运行得很好,但第二天早上一来,就出现了问题。网页里的数据不能显示出来,只有当再次发贴时,才显示出来。

2)第二个问题是:有时发一个贴时,点击浏览时,要好久(1-2分钟)才能浏览,但不是当天发的贴,瞬间就可以查看,不知道是什么回事?

3)第三个问题是:点击更新时,不同步数据库,用了flush但更新后,还是出现原来的数据?不知道如何解决?

谢谢!

[code] <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="com.voff.News" table="news">
<id name="nid">
<generator class="increment"/>
</id>
<property name="ncontent" />
<property name="hits" />
<property name="nauthor"/>
<property name="ntitle"/>
<property name="time"/>
<property name="iftop"/>
<property name="ifshow"/>
<property name="cateid"/>
<property name="lastupdate"/>

</class>

</hibernate-mapping> [/code]

[code]<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="connection.url">
jdbc:mysql://localhost/news?useUnicode=true&characterEncoding=UTF-8
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="myeclipse.connection.profile">Mysql</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>


<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">30</property>
<property name="c3p0.time_out">1800</property>
<property name="c3p0.max_statement">50</property>
<property name="connection.pool_size">1</property>


<mapping resource="com/voff/News.hbm.xml" />
<mapping resource="com/voff/User.hbm.xml" />
<mapping resource="com/voff/Comment.hbm.xml" />
<mapping resource="com/voff/Category.hbm.xml" />
<mapping resource="com/voff/Pk.hbm.xml" />
<mapping resource="com/voff/Qa.hbm.xml" />
<mapping resource="com/voff/Logs.hbm.xml" />
</session-factory>

</hibernate-configuration>[/code]
我的hibernate配置,google了一下,但还是没有解决问题。继续求助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值