-->
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.  [ 2 posts ] 
Author Message
 Post subject: How Hibernate can know the change updated by other program
PostPosted: Wed Jun 17, 2009 2:02 am 
Newbie

Joined: Wed Jun 17, 2009 1:38 am
Posts: 2
Hi, All,
I got a problem when use Hibernate.
In my web app, I use Hibernate to manipulate the MySQL DB named "testDB", meanwhile, another program modify testDB,
the problem is hibernate can not know the change of testDB, even I use session.clear() and change the HQL each time.
The detail is:
TestDAO dao = new TestDAO();
dao.getSession().clear();
List list = dao.findAll();
The third-part program change the testDB, but each time the list is unchanged!
Even I change the way I get the list to:
List list = dao.findByHQL("from Test where id<"+System.currentTimeMillis()); // to make the HQL different every time.
The list still can not know the change of testDB.

Anyone know how to solve the problem?
Many thanks!


Top
 Profile  
 
 Post subject: Re: How Hibernate can know the change updated by other program
PostPosted: Wed Jun 17, 2009 2:06 am 
Newbie

Joined: Wed Jun 17, 2009 1:38 am
Posts: 2
It seems it is not relative to the Session level cache.
Is Hibernate cache the whole DB? or it cache the query by key->value, where the key is the HQL query string after calculated?


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

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.