Message:
The following issue has been closed.
Resolver: Gavin King
Date: Tue, 2 Sep 2003 3:08 AM
fixed in 2.1 branch in CVS
---------------------------------------------------------------------
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: Closed
Priority: Minor
Resolution: FIXED
Project: Hibernate2
Components:
core
Fix Fors:
2.1 beta 3
Versions:
2.0.2
Assignee: Gavin King
Reporter: John Kristian
Created: Wed, 27 Aug 2003 3:01 PM
Updated: Tue, 2 Sep 2003 3:08 AM
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
|