From: <leg...@at...> - 2003-08-27 20:02:27
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-295 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-295 Summary: Session.refresh leaves old data in JCS cache Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.0.2 Assignee: Reporter: John Kristian Created: Wed, 27 Aug 2003 3:01 PM Updated: Wed, 27 Aug 2003 3:01 PM Environment: Windows XP, Microsoft SQL Server, JBoss 3 Description: http://sourceforge.net/forum/message.php?msg_id=2078891 Session session = sessionFactory.openSession(); Foo foo = session.load(Foo.class, id); // (1) // Now execute SQL via JDBC (not Hibernate) that changes the data from which foo is mapped. // (2) workaround: sessionFactory.evict(Foo.class, id); session.refresh(foo); // foo is copied from the database session.close(); session = sf.openSession(); Foo foo2 = session.load(Foo.class, id); // At this point, foo2 contains different data than foo. // foo2 contains the old data that foo contained at (1) above. session.close(); foo2 should contain the new data, just like foo. Ideally, session.refresh() would copy the new data into the cache. At least, it should invalidate the old cached data. One can work around this problem, by calling sessionFactory.evict at (2) above. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |