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!
|