-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: update之后查询结果不稳定
PostPosted: Thu Nov 18, 2010 8:04 am 
Newbie

Joined: Thu Nov 18, 2010 7:49 am
Posts: 1
大家好,我英文不好,只能说中文,请大家原谅。
我遇到了个问题,如题,在WEB 应用开发中,调用session的update(),然后提交事物,之后,数据库中的数据成功更新了,但查询数据库显示结果不稳定,一会儿显示更新之前的数据,一会儿显示更新之后的数据。
详细情况是这样的。在WEB页面中调用HIBERNATE DAO执行update来更新数据,然后用另外一个网页执行查询并显示查询结果。查询方法如下:
Query q = getSession().createQuery("from T order by idx");
List li=q.list();
一开始我用HIBERNATE自带的连接池,发先了查询结果不稳定现象,然后我换成C3P0,问题依旧。项目中我没有运用二级缓存,并且每次执行更新操作后都提交了事物commit()。
这个问题困扰了我很久,网上搜索了很多文章,一直没有找到解决办法,这里是我最后求助的地方,希望同仁们能帮我想想办法。在这里先谢谢大家!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.